commit
c0e33d00d0
|
|
@ -146,3 +146,10 @@ export function deleteCodegenTable(tableId: number) {
|
||||||
params: { tableId },
|
params: { tableId },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除代码生成表定义 */
|
||||||
|
export function deleteCodegenTableList(tableIds: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/codegen/delete-list?tableIds=${tableIds.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,11 @@ export function deleteConfig(id: number) {
|
||||||
return requestClient.delete(`/infra/config/delete?id=${id}`);
|
return requestClient.delete(`/infra/config/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除参数 */
|
||||||
|
export function deleteConfigList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/infra/config/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出参数 */
|
/** 导出参数 */
|
||||||
export function exportConfig(params: any) {
|
export function exportConfig(params: any) {
|
||||||
return requestClient.download('/infra/config/export', {
|
return requestClient.download('/infra/config/export', {
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,13 @@ export function deleteFileConfig(id: number) {
|
||||||
return requestClient.delete(`/infra/file-config/delete?id=${id}`);
|
return requestClient.delete(`/infra/file-config/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除文件配置 */
|
||||||
|
export function deleteFileConfigList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/file-config/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 测试文件配置 */
|
/** 测试文件配置 */
|
||||||
export function testFileConfig(id: number) {
|
export function testFileConfig(id: number) {
|
||||||
return requestClient.get(`/infra/file-config/test?id=${id}`);
|
return requestClient.get(`/infra/file-config/test?id=${id}`);
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,11 @@ export function deleteFile(id: number) {
|
||||||
return requestClient.delete(`/infra/file/delete?id=${id}`);
|
return requestClient.delete(`/infra/file/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除文件 */
|
||||||
|
export function deleteFileList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/infra/file/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
/** 获取文件预签名地址 */
|
/** 获取文件预签名地址 */
|
||||||
export function getFilePresignedUrl(name: string, directory?: string) {
|
export function getFilePresignedUrl(name: string, directory?: string) {
|
||||||
return requestClient.get<InfraFileApi.FilePresignedUrlResp>(
|
return requestClient.get<InfraFileApi.FilePresignedUrlResp>(
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,11 @@ export function deleteJob(id: number) {
|
||||||
return requestClient.delete(`/infra/job/delete?id=${id}`);
|
return requestClient.delete(`/infra/job/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除定时任务调度 */
|
||||||
|
export function deleteJobList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/infra/job/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出定时任务调度 */
|
/** 导出定时任务调度 */
|
||||||
export function exportJob(params: any) {
|
export function exportJob(params: any) {
|
||||||
return requestClient.download('/infra/job/export-excel', { params });
|
return requestClient.download('/infra/job/export-excel', { params });
|
||||||
|
|
|
||||||
|
|
@ -45,3 +45,8 @@ export async function updateDept(data: SystemDeptApi.Dept) {
|
||||||
export async function deleteDept(id: number) {
|
export async function deleteDept(id: number) {
|
||||||
return requestClient.delete(`/system/dept/delete?id=${id}`);
|
return requestClient.delete(`/system/dept/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除部门 */
|
||||||
|
export async function deleteDeptList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/system/dept/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,13 @@ export function deleteDictData(id: number) {
|
||||||
return requestClient.delete(`/system/dict-data/delete?id=${id}`);
|
return requestClient.delete(`/system/dict-data/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量删除字典数据
|
||||||
|
export function deleteDictDataList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/dict-data/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// 导出字典类型数据
|
// 导出字典类型数据
|
||||||
export function exportDictData(params: any) {
|
export function exportDictData(params: any) {
|
||||||
return requestClient.download('/system/dict-data/export', { params });
|
return requestClient.download('/system/dict-data/export', { params });
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,13 @@ export function deleteDictType(id: number) {
|
||||||
return requestClient.delete(`/system/dict-type/delete?id=${id}`);
|
return requestClient.delete(`/system/dict-type/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量删除字典
|
||||||
|
export function deleteDictTypeList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/dict-type/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// 导出字典类型
|
// 导出字典类型
|
||||||
export function exportDictType(params: any) {
|
export function exportDictType(params: any) {
|
||||||
return requestClient.download('/system/dict-type/export', { params });
|
return requestClient.download('/system/dict-type/export', { params });
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,13 @@ export function deleteMailAccount(id: number) {
|
||||||
return requestClient.delete(`/system/mail-account/delete?id=${id}`);
|
return requestClient.delete(`/system/mail-account/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除邮箱账号 */
|
||||||
|
export function deleteMailAccountList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/mail-account/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 获得邮箱账号精简列表 */
|
/** 获得邮箱账号精简列表 */
|
||||||
export function getSimpleMailAccountList() {
|
export function getSimpleMailAccountList() {
|
||||||
return requestClient.get<SystemMailAccountApi.MailAccount[]>(
|
return requestClient.get<SystemMailAccountApi.MailAccount[]>(
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,13 @@ export function deleteMailTemplate(id: number) {
|
||||||
return requestClient.delete(`/system/mail-template/delete?id=${id}`);
|
return requestClient.delete(`/system/mail-template/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除邮件模板 */
|
||||||
|
export function deleteMailTemplateList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/mail-template/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 发送邮件 */
|
/** 发送邮件 */
|
||||||
export function sendMail(data: SystemMailTemplateApi.MailSendReq) {
|
export function sendMail(data: SystemMailTemplateApi.MailSendReq) {
|
||||||
return requestClient.post('/system/mail-template/send-mail', data);
|
return requestClient.post('/system/mail-template/send-mail', data);
|
||||||
|
|
|
||||||
|
|
@ -52,3 +52,8 @@ export async function updateMenu(data: SystemMenuApi.Menu) {
|
||||||
export async function deleteMenu(id: number) {
|
export async function deleteMenu(id: number) {
|
||||||
return requestClient.delete(`/system/menu/delete?id=${id}`);
|
return requestClient.delete(`/system/menu/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除菜单 */
|
||||||
|
export async function deleteMenuList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/system/menu/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,13 @@ export function deleteNotice(id: number) {
|
||||||
return requestClient.delete(`/system/notice/delete?id=${id}`);
|
return requestClient.delete(`/system/notice/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除公告 */
|
||||||
|
export function deleteNoticeList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/notice/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 推送公告 */
|
/** 推送公告 */
|
||||||
export function pushNotice(id: number) {
|
export function pushNotice(id: number) {
|
||||||
return requestClient.post(`/system/notice/push?id=${id}`);
|
return requestClient.post(`/system/notice/push?id=${id}`);
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,13 @@ export function deleteNotifyTemplate(id: number) {
|
||||||
return requestClient.delete(`/system/notify-template/delete?id=${id}`);
|
return requestClient.delete(`/system/notify-template/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除站内信模板 */
|
||||||
|
export function deleteNotifyTemplateList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/notify-template/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出站内信模板 */
|
/** 导出站内信模板 */
|
||||||
export function exportNotifyTemplate(params: any) {
|
export function exportNotifyTemplate(params: any) {
|
||||||
return requestClient.download('/system/notify-template/export-excel', {
|
return requestClient.download('/system/notify-template/export-excel', {
|
||||||
|
|
|
||||||
|
|
@ -32,3 +32,10 @@ export function deleteOAuth2Token(accessToken: string) {
|
||||||
`/system/oauth2-token/delete?accessToken=${accessToken}`,
|
`/system/oauth2-token/delete?accessToken=${accessToken}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除 OAuth2.0 令牌 */
|
||||||
|
export function deleteOAuth2TokenList(accessTokens: string[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/oauth2-token/delete-list?accessTokens=${accessTokens.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,11 @@ export function deletePost(id: number) {
|
||||||
return requestClient.delete(`/system/post/delete?id=${id}`);
|
return requestClient.delete(`/system/post/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除岗位 */
|
||||||
|
export function deletePostList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/system/post/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出岗位 */
|
/** 导出岗位 */
|
||||||
export function exportPost(params: any) {
|
export function exportPost(params: any) {
|
||||||
return requestClient.download('/system/post/export', {
|
return requestClient.download('/system/post/export', {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,11 @@ export function deleteRole(id: number) {
|
||||||
return requestClient.delete(`/system/role/delete?id=${id}`);
|
return requestClient.delete(`/system/role/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除角色 */
|
||||||
|
export function deleteRoleList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/system/role/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出角色 */
|
/** 导出角色 */
|
||||||
export function exportRole(params: any) {
|
export function exportRole(params: any) {
|
||||||
return requestClient.download('/system/role/export-excel', {
|
return requestClient.download('/system/role/export-excel', {
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,13 @@ export function deleteSmsChannel(id: number) {
|
||||||
return requestClient.delete(`/system/sms-channel/delete?id=${id}`);
|
return requestClient.delete(`/system/sms-channel/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除短信渠道 */
|
||||||
|
export function deleteSmsChannelList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/sms-channel/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出短信渠道 */
|
/** 导出短信渠道 */
|
||||||
export function exportSmsChannel(params: any) {
|
export function exportSmsChannel(params: any) {
|
||||||
return requestClient.download('/system/sms-channel/export', { params });
|
return requestClient.download('/system/sms-channel/export', { params });
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,13 @@ export function deleteSmsTemplate(id: number) {
|
||||||
return requestClient.delete(`/system/sms-template/delete?id=${id}`);
|
return requestClient.delete(`/system/sms-template/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除短信模板 */
|
||||||
|
export function deleteSmsTemplateList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/sms-template/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出短信模板 */
|
/** 导出短信模板 */
|
||||||
export function exportSmsTemplate(params: any) {
|
export function exportSmsTemplate(params: any) {
|
||||||
return requestClient.download('/system/sms-template/export-excel', {
|
return requestClient.download('/system/sms-template/export-excel', {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,13 @@ export function deleteTenantPackage(id: number) {
|
||||||
return requestClient.delete(`/system/tenant-package/delete?id=${id}`);
|
return requestClient.delete(`/system/tenant-package/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除租户套餐 */
|
||||||
|
export function deleteTenantPackageList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/tenant-package/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 获取租户套餐精简信息列表 */
|
/** 获取租户套餐精简信息列表 */
|
||||||
export function getTenantPackageList() {
|
export function getTenantPackageList() {
|
||||||
return requestClient.get<SystemTenantPackageApi.TenantPackage[]>(
|
return requestClient.get<SystemTenantPackageApi.TenantPackage[]>(
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,13 @@ export function deleteTenant(id: number) {
|
||||||
return requestClient.delete(`/system/tenant/delete?id=${id}`);
|
return requestClient.delete(`/system/tenant/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除租户 */
|
||||||
|
export function deleteTenantList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/system/tenant/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出租户 */
|
/** 导出租户 */
|
||||||
export function exportTenant(params: any) {
|
export function exportTenant(params: any) {
|
||||||
return requestClient.download('/system/tenant/export-excel', {
|
return requestClient.download('/system/tenant/export-excel', {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,11 @@ export function deleteUser(id: number) {
|
||||||
return requestClient.delete(`/system/user/delete?id=${id}`);
|
return requestClient.delete(`/system/user/delete?id=${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量删除用户 */
|
||||||
|
export function deleteUserList(ids: number[]) {
|
||||||
|
return requestClient.delete(`/system/user/delete-list?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
/** 导出用户 */
|
/** 导出用户 */
|
||||||
export function exportUser(params: any) {
|
export function exportUser(params: any) {
|
||||||
return requestClient.download('/system/user/export', params);
|
return requestClient.download('/system/user/export', params);
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,7 @@ export function useGridColumns(
|
||||||
getDataSourceConfigName?: (dataSourceConfigId: number) => string | undefined,
|
getDataSourceConfigName?: (dataSourceConfigId: number) => string | undefined,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'dataSourceConfigId',
|
field: 'dataSourceConfigId',
|
||||||
title: '数据源',
|
title: '数据源',
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,14 @@ import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteCodegenTable,
|
deleteCodegenTable,
|
||||||
|
deleteCodegenTableList,
|
||||||
downloadCodegen,
|
downloadCodegen,
|
||||||
getCodegenTablePage,
|
getCodegenTablePage,
|
||||||
syncCodegenFromDB,
|
syncCodegenFromDB,
|
||||||
|
|
@ -82,6 +84,31 @@ async function handleDelete(row: InfraCodegenApi.CodegenTable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: InfraCodegenApi.CodegenTable[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除代码生成配置 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteCodegenTableList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 同步数据库 */
|
/** 同步数据库 */
|
||||||
async function handleSync(row: InfraCodegenApi.CodegenTable) {
|
async function handleSync(row: InfraCodegenApi.CodegenTable) {
|
||||||
const hideLoading = message.loading({
|
const hideLoading = message.loading({
|
||||||
|
|
@ -145,12 +172,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<InfraCodegenApi.CodegenTable>,
|
} as VxeTableGridOptions<InfraCodegenApi.CodegenTable>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 获取数据源配置列表 */
|
/** 获取数据源配置列表 */
|
||||||
|
|
@ -196,6 +228,15 @@ initDataSourceConfig();
|
||||||
auth: ['infra:codegen:create'],
|
auth: ['infra:codegen:create'],
|
||||||
onClick: handleImport,
|
onClick: handleImport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['infra:codegen:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '参数主键',
|
title: '参数主键',
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,20 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { InfraConfigApi } from '#/api/infra/config';
|
import type { InfraConfigApi } from '#/api/infra/config';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deleteConfig, exportConfig, getConfigPage } from '#/api/infra/config';
|
import {
|
||||||
|
deleteConfig,
|
||||||
|
deleteConfigList,
|
||||||
|
exportConfig,
|
||||||
|
getConfigPage,
|
||||||
|
} from '#/api/infra/config';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
@ -59,6 +66,31 @@ async function handleDelete(row: InfraConfigApi.Config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: InfraConfigApi.Config[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除参数 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteConfigList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -80,12 +112,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<InfraConfigApi.Config>,
|
} as VxeTableGridOptions<InfraConfigApi.Config>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -110,6 +147,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['infra:config:export'],
|
auth: ['infra:config:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['infra:config:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '文件名',
|
title: '文件名',
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,16 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { InfraFileApi } from '#/api/infra/file';
|
import type { InfraFileApi } from '#/api/infra/file';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { openWindow } from '@vben/utils';
|
import { isEmpty, openWindow } from '@vben/utils';
|
||||||
|
|
||||||
import { useClipboard } from '@vueuse/core';
|
import { useClipboard } from '@vueuse/core';
|
||||||
import { Button, Image, message } from 'ant-design-vue';
|
import { Button, Image, message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deleteFile, getFilePage } from '#/api/infra/file';
|
import { deleteFile, deleteFileList, getFilePage } from '#/api/infra/file';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
@ -64,6 +66,31 @@ async function handleDelete(row: InfraFileApi.File) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: InfraFileApi.File[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除文件 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteFileList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -85,12 +112,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<InfraFileApi.File>,
|
} as VxeTableGridOptions<InfraFileApi.File>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -108,6 +140,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['infra:file:create'],
|
auth: ['infra:file:create'],
|
||||||
onClick: handleUpload,
|
onClick: handleUpload,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['infra:file:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { InfraFileConfigApi } from '#/api/infra/file-config';
|
import type { InfraFileConfigApi } from '#/api/infra/file-config';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { openWindow } from '@vben/utils';
|
import { isEmpty, openWindow } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteFileConfig,
|
deleteFileConfig,
|
||||||
|
deleteFileConfigList,
|
||||||
getFileConfigPage,
|
getFileConfigPage,
|
||||||
testFileConfig,
|
testFileConfig,
|
||||||
updateFileConfigMaster,
|
updateFileConfigMaster,
|
||||||
|
|
@ -97,6 +100,31 @@ async function handleDelete(row: InfraFileConfigApi.FileConfig) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: InfraFileConfigApi.FileConfig[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除文件配置 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteFileConfigList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -118,12 +146,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<InfraFileConfigApi.FileConfig>,
|
} as VxeTableGridOptions<InfraFileConfigApi.FileConfig>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -141,6 +174,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['infra:file-config:create'],
|
auth: ['infra:file-config:create'],
|
||||||
onClick: handleCreate,
|
onClick: handleCreate,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['infra:file-config:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 表格列配置 */
|
/** 表格列配置 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '任务编号',
|
title: '任务编号',
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,18 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { InfraJobApi } from '#/api/infra/job';
|
import type { InfraJobApi } from '#/api/infra/job';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteJob,
|
deleteJob,
|
||||||
|
deleteJobList,
|
||||||
exportJob,
|
exportJob,
|
||||||
getJobPage,
|
getJobPage,
|
||||||
runJob,
|
runJob,
|
||||||
|
|
@ -114,6 +116,27 @@ async function handleDelete(row: InfraJobApi.Job) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({ records }: { records: InfraJobApi.Job[] }) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除任务 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteJobList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -135,12 +158,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<InfraJobApi.Job>,
|
} as VxeTableGridOptions<InfraJobApi.Job>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -177,7 +205,16 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'lucide:history',
|
icon: 'lucide:history',
|
||||||
auth: ['infra:job:export'],
|
auth: ['infra:job:export'],
|
||||||
onClick: handleExport,
|
onClick: handleLog,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['infra:job:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ export function useGridColumns(
|
||||||
getLeaderName?: (userId: number) => string | undefined,
|
getLeaderName?: (userId: number) => string | undefined,
|
||||||
): VxeTableGridOptions<SystemDeptApi.Dept>['columns'] {
|
): VxeTableGridOptions<SystemDeptApi.Dept>['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '部门名称',
|
title: '部门名称',
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@ import type { SystemUserApi } from '#/api/system/user';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deleteDept, getDeptList } from '#/api/system/dept';
|
import { deleteDept, deleteDeptList, getDeptList } from '#/api/system/dept';
|
||||||
import { getSimpleUserList } from '#/api/system/user';
|
import { getSimpleUserList } from '#/api/system/user';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
|
|
@ -74,35 +75,62 @@ async function handleDelete(row: SystemDeptApi.Dept) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemDeptApi.Dept[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除部门 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteDeptList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useGridColumns(getLeaderName),
|
columns: useGridColumns(getLeaderName),
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
|
||||||
pagerConfig: {
|
|
||||||
enabled: false,
|
|
||||||
},
|
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async (_params) => {
|
query: async () => {
|
||||||
return await getDeptList();
|
return await getDeptList();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
|
search: true,
|
||||||
},
|
},
|
||||||
treeConfig: {
|
treeConfig: {
|
||||||
parentField: 'parentId',
|
|
||||||
rowField: 'id',
|
|
||||||
transform: true,
|
transform: true,
|
||||||
|
rowField: 'id',
|
||||||
|
parentField: 'parentId',
|
||||||
expandAll: true,
|
expandAll: true,
|
||||||
reserve: true,
|
accordion: false,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions,
|
} as VxeTableGridOptions<SystemDeptApi.Dept>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
|
|
@ -130,6 +158,15 @@ onMounted(async () => {
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
onClick: toggleExpand,
|
onClick: toggleExpand,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:dept:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ export function useTypeGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 类型列表的字段 */
|
/** 类型列表的字段 */
|
||||||
export function useTypeGridColumns(): VxeTableGridOptions['columns'] {
|
export function useTypeGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '字典编号',
|
title: '字典编号',
|
||||||
|
|
@ -288,6 +289,7 @@ export function useDataGridFormSchema(): VbenFormSchema[] {
|
||||||
*/
|
*/
|
||||||
export function useDataGridColumns(): VxeTableGridOptions['columns'] {
|
export function useDataGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '字典编码',
|
title: '字典编码',
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemDictDataApi } from '#/api/system/dict/data';
|
import type { SystemDictDataApi } from '#/api/system/dict/data';
|
||||||
|
|
||||||
import { watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteDictData,
|
deleteDictData,
|
||||||
|
deleteDictDataList,
|
||||||
exportDictData,
|
exportDictData,
|
||||||
getDictDataPage,
|
getDictDataPage,
|
||||||
} from '#/api/system/dict/data';
|
} from '#/api/system/dict/data';
|
||||||
|
|
@ -71,6 +72,31 @@ async function handleDelete(row: SystemDictDataApi.DictData) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemDictDataApi.DictData[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除字典数据 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteDictDataList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useDataGridFormSchema(),
|
schema: useDataGridFormSchema(),
|
||||||
|
|
@ -93,12 +119,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemDictDataApi.DictData>,
|
} as VxeTableGridOptions<SystemDictDataApi.DictData>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 监听 dictType 变化,重新查询 */
|
/** 监听 dictType 变化,重新查询 */
|
||||||
|
|
@ -134,6 +165,15 @@ watch(
|
||||||
auth: ['system:dict:export'],
|
auth: ['system:dict:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:dict:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,17 @@ import type {
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
import type { SystemDictTypeApi } from '#/api/system/dict/type';
|
import type { SystemDictTypeApi } from '#/api/system/dict/type';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteDictType,
|
deleteDictType,
|
||||||
|
deleteDictTypeList,
|
||||||
exportDictType,
|
exportDictType,
|
||||||
getDictTypePage,
|
getDictTypePage,
|
||||||
} from '#/api/system/dict/type';
|
} from '#/api/system/dict/type';
|
||||||
|
|
@ -67,11 +70,38 @@ async function handleDelete(row: SystemDictTypeApi.DictType) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemDictTypeApi.DictType[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除字典类型 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteDictTypeList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 表格事件 */
|
/** 表格事件 */
|
||||||
const gridEvents: VxeGridListeners<SystemDictTypeApi.DictType> = {
|
const gridEvents: VxeGridListeners<SystemDictTypeApi.DictType> = {
|
||||||
cellClick: ({ row }) => {
|
cellClick: ({ row }) => {
|
||||||
emit('select', row.type);
|
emit('select', row.type);
|
||||||
},
|
},
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
};
|
};
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
|
|
@ -81,7 +111,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useTypeGridColumns(),
|
columns: useTypeGridColumns(),
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }, formValues) => {
|
query: async ({ page }, formValues) => {
|
||||||
|
|
@ -96,6 +125,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
isCurrent: true,
|
isCurrent: true,
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
|
|
@ -128,6 +158,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:dict:export'],
|
auth: ['system:dict:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:dict:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemMailAccountApi } from '#/api/system/mail/account';
|
import type { SystemMailAccountApi } from '#/api/system/mail/account';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteMailAccount,
|
deleteMailAccount,
|
||||||
|
deleteMailAccountList,
|
||||||
getMailAccountPage,
|
getMailAccountPage,
|
||||||
} from '#/api/system/mail/account';
|
} from '#/api/system/mail/account';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
@ -54,6 +58,31 @@ async function handleDelete(row: SystemMailAccountApi.MailAccount) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemMailAccountApi.MailAccount[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除邮箱账号 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteMailAccountList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -75,12 +104,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemMailAccountApi.MailAccount>,
|
} as VxeTableGridOptions<SystemMailAccountApi.MailAccount>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -101,6 +135,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:mail-account:create'],
|
auth: ['system:mail-account:create'],
|
||||||
onClick: handleCreate,
|
onClick: handleCreate,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:mail-account:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -121,7 +164,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
icon: ACTION_ICON.DELETE,
|
icon: ACTION_ICON.DELETE,
|
||||||
auth: ['system:mail-account:delete'],
|
auth: ['system:mail-account:delete'],
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
|
title: $t('ui.actionMessage.deleteConfirm', [row.mail]),
|
||||||
confirm: handleDelete.bind(null, row),
|
confirm: handleDelete.bind(null, row),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ export function useGridColumns(
|
||||||
getAccountMail?: (accountId: number) => string | undefined,
|
getAccountMail?: (accountId: number) => string | undefined,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import type { SystemMailTemplateApi } from '#/api/system/mail/template';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
|
|
@ -13,6 +14,7 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getSimpleMailAccountList } from '#/api/system/mail/account';
|
import { getSimpleMailAccountList } from '#/api/system/mail/account';
|
||||||
import {
|
import {
|
||||||
deleteMailTemplate,
|
deleteMailTemplate,
|
||||||
|
deleteMailTemplateList,
|
||||||
getMailTemplatePage,
|
getMailTemplatePage,
|
||||||
} from '#/api/system/mail/template';
|
} from '#/api/system/mail/template';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
@ -68,6 +70,31 @@ async function handleDelete(row: SystemMailTemplateApi.MailTemplate) {
|
||||||
onRefresh();
|
onRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemMailTemplateApi.MailTemplate[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除邮件模板 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteMailTemplateList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 获取邮箱账号 */
|
/** 获取邮箱账号 */
|
||||||
function getAccountMail(accountId: number) {
|
function getAccountMail(accountId: number) {
|
||||||
return accountList.value.find((account) => account.id === accountId)?.mail;
|
return accountList.value.find((account) => account.id === accountId)?.mail;
|
||||||
|
|
@ -94,12 +121,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemMailTemplateApi.MailTemplate>,
|
} as VxeTableGridOptions<SystemMailTemplateApi.MailTemplate>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
|
|
@ -126,6 +158,15 @@ onMounted(async () => {
|
||||||
auth: ['system:mail-template:create'],
|
auth: ['system:mail-template:create'],
|
||||||
onClick: handleCreate,
|
onClick: handleCreate,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:mail-template:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '公告编号',
|
title: '公告编号',
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,20 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemNoticeApi } from '#/api/system/notice';
|
import type { SystemNoticeApi } from '#/api/system/notice';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deleteNotice, getNoticePage, pushNotice } from '#/api/system/notice';
|
import {
|
||||||
|
deleteNotice,
|
||||||
|
deleteNoticeList,
|
||||||
|
getNoticePage,
|
||||||
|
pushNotice,
|
||||||
|
} from '#/api/system/notice';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
@ -51,6 +59,31 @@ async function handleDelete(row: SystemNoticeApi.Notice) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemNoticeApi.Notice[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除公告 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteNoticeList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 推送公告 */
|
/** 推送公告 */
|
||||||
async function handlePush(row: SystemNoticeApi.Notice) {
|
async function handlePush(row: SystemNoticeApi.Notice) {
|
||||||
const hideLoading = message.loading({
|
const hideLoading = message.loading({
|
||||||
|
|
@ -89,12 +122,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemNoticeApi.Notice>,
|
} as VxeTableGridOptions<SystemNoticeApi.Notice>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -112,6 +150,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:notice:create'],
|
auth: ['system:notice:create'],
|
||||||
onClick: handleCreate,
|
onClick: handleCreate,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:notice:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -139,7 +186,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
icon: ACTION_ICON.DELETE,
|
icon: ACTION_ICON.DELETE,
|
||||||
auth: ['system:notice:delete'],
|
auth: ['system:notice:delete'],
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
|
title: $t('ui.actionMessage.deleteConfirm', [row.title]),
|
||||||
confirm: handleDelete.bind(null, row),
|
confirm: handleDelete.bind(null, row),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,7 @@ export function useSendNotifyFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemNotifyTemplateApi } from '#/api/system/notify/template';
|
import type { SystemNotifyTemplateApi } from '#/api/system/notify/template';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteNotifyTemplate,
|
deleteNotifyTemplate,
|
||||||
|
deleteNotifyTemplateList,
|
||||||
exportNotifyTemplate,
|
exportNotifyTemplate,
|
||||||
getNotifyTemplatePage,
|
getNotifyTemplatePage,
|
||||||
} from '#/api/system/notify/template';
|
} from '#/api/system/notify/template';
|
||||||
|
|
@ -73,6 +76,31 @@ async function handleDelete(row: SystemNotifyTemplateApi.NotifyTemplate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemNotifyTemplateApi.NotifyTemplate[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除站内信模板 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteNotifyTemplateList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -94,12 +122,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemNotifyTemplateApi.NotifyTemplate>,
|
} as VxeTableGridOptions<SystemNotifyTemplateApi.NotifyTemplate>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -129,6 +162,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:notify-template:export'],
|
auth: ['system:notify-template:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:notify-template:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'accessToken',
|
field: 'accessToken',
|
||||||
title: '访问令牌',
|
title: '访问令牌',
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '岗位编号',
|
title: '岗位编号',
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,20 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemPostApi } from '#/api/system/post';
|
import type { SystemPostApi } from '#/api/system/post';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deletePost, exportPost, getPostPage } from '#/api/system/post';
|
import {
|
||||||
|
deletePost,
|
||||||
|
deletePostList,
|
||||||
|
exportPost,
|
||||||
|
getPostPage,
|
||||||
|
} from '#/api/system/post';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
@ -58,6 +65,31 @@ async function handleDelete(row: SystemPostApi.Post) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemPostApi.Post[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除岗位 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deletePostList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -79,12 +111,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemPostApi.Post>,
|
} as VxeTableGridOptions<SystemPostApi.Post>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -109,6 +146,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:post:export'],
|
auth: ['system:post:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:post:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '角色编号',
|
title: '角色编号',
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,20 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemRoleApi } from '#/api/system/role';
|
import type { SystemRoleApi } from '#/api/system/role';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deleteRole, exportRole, getRolePage } from '#/api/system/role';
|
import {
|
||||||
|
deleteRole,
|
||||||
|
deleteRoleList,
|
||||||
|
exportRole,
|
||||||
|
getRolePage,
|
||||||
|
} from '#/api/system/role';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
@ -71,6 +78,31 @@ async function handleDelete(row: SystemRoleApi.Role) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemRoleApi.Role[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除角色 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteRoleList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 分配角色的数据权限 */
|
/** 分配角色的数据权限 */
|
||||||
function handleAssignDataPermission(row: SystemRoleApi.Role) {
|
function handleAssignDataPermission(row: SystemRoleApi.Role) {
|
||||||
assignDataPermissionFormApi.setData(row).open();
|
assignDataPermissionFormApi.setData(row).open();
|
||||||
|
|
@ -93,7 +125,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }, formValues) => {
|
query: async ({ page }, formValues) => {
|
||||||
return await getRolePage({
|
return await getRolePage({
|
||||||
page: page.currentPage,
|
pageNo: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
...formValues,
|
...formValues,
|
||||||
});
|
});
|
||||||
|
|
@ -102,12 +134,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemRoleApi.Role>,
|
} as VxeTableGridOptions<SystemRoleApi.Role>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -142,6 +179,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:role:export'],
|
auth: ['system:role:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:role:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
|
import type { SystemSmsChannelApi } from '#/api/system/sms/channel';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteSmsChannel,
|
deleteSmsChannel,
|
||||||
|
deleteSmsChannelList,
|
||||||
exportSmsChannel,
|
exportSmsChannel,
|
||||||
getSmsChannelPage,
|
getSmsChannelPage,
|
||||||
} from '#/api/system/sms/channel';
|
} from '#/api/system/sms/channel';
|
||||||
|
|
@ -62,6 +65,39 @@ async function handleDelete(row: SystemSmsChannelApi.SmsChannel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选中的短信渠道ID
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemSmsChannelApi.SmsChannel[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除处理 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
if (checkedIds.value.length === 0) {
|
||||||
|
message.warning('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting', ['短信渠道']),
|
||||||
|
key: 'action_key_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteSmsChannelList(checkedIds.value);
|
||||||
|
message.success({
|
||||||
|
content: $t('ui.actionMessage.deleteSuccess', ['短信渠道']),
|
||||||
|
key: 'action_key_msg',
|
||||||
|
});
|
||||||
|
checkedIds.value = [];
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -83,12 +119,20 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
|
checkboxConfig: {
|
||||||
|
checkField: 'checked',
|
||||||
|
},
|
||||||
} as VxeTableGridOptions<SystemSmsChannelApi.SmsChannel>,
|
} as VxeTableGridOptions<SystemSmsChannelApi.SmsChannel>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -117,6 +161,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:sms-channel:export'],
|
auth: ['system:sms-channel:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:sms-channel:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -137,7 +190,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
icon: ACTION_ICON.DELETE,
|
icon: ACTION_ICON.DELETE,
|
||||||
auth: ['system:sms-channel:delete'],
|
auth: ['system:sms-channel:delete'],
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: $t('ui.actionMessage.deleteConfirm', [row.name]),
|
title: $t('ui.actionMessage.deleteConfirm', [row.signature]),
|
||||||
confirm: handleDelete.bind(null, row),
|
confirm: handleDelete.bind(null, row),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,7 @@ export function useSendSmsFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemSmsTemplateApi } from '#/api/system/sms/template';
|
import type { SystemSmsTemplateApi } from '#/api/system/sms/template';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteSmsTemplate,
|
deleteSmsTemplate,
|
||||||
|
deleteSmsTemplateList,
|
||||||
exportSmsTemplate,
|
exportSmsTemplate,
|
||||||
getSmsTemplatePage,
|
getSmsTemplatePage,
|
||||||
} from '#/api/system/sms/template';
|
} from '#/api/system/sms/template';
|
||||||
|
|
@ -73,6 +76,31 @@ async function handleDelete(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemSmsTemplateApi.SmsTemplate[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除短信模板 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteSmsTemplateList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -94,12 +122,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemSmsTemplateApi.SmsTemplate>,
|
} as VxeTableGridOptions<SystemSmsTemplateApi.SmsTemplate>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -129,6 +162,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:sms-template:export'],
|
auth: ['system:sms-template:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:sms-template:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ export function useGridColumns(
|
||||||
getPackageName?: (packageId: number) => string | undefined,
|
getPackageName?: (packageId: number) => string | undefined,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '租户编号',
|
title: '租户编号',
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,17 @@ import type { SystemTenantPackageApi } from '#/api/system/tenant-package';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { deleteTenant, exportTenant, getTenantPage } from '#/api/system/tenant';
|
import {
|
||||||
|
deleteTenant,
|
||||||
|
deleteTenantList,
|
||||||
|
exportTenant,
|
||||||
|
getTenantPage,
|
||||||
|
} from '#/api/system/tenant';
|
||||||
import { getTenantPackageList } from '#/api/system/tenant-package';
|
import { getTenantPackageList } from '#/api/system/tenant-package';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
|
|
@ -72,6 +77,31 @@ async function handleDelete(row: SystemTenantApi.Tenant) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemTenantApi.Tenant[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除租户 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteTenantList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -91,12 +121,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemTenantApi.Tenant>,
|
} as VxeTableGridOptions<SystemTenantApi.Tenant>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 初始化 */
|
/** 初始化 */
|
||||||
|
|
@ -129,6 +164,15 @@ onMounted(async () => {
|
||||||
auth: ['system:tenant:export'],
|
auth: ['system:tenant:export'],
|
||||||
onClick: handleExport,
|
onClick: handleExport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:tenant:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
/** 列表的字段 */
|
/** 列表的字段 */
|
||||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '套餐编号',
|
title: '套餐编号',
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,17 @@
|
||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { SystemTenantPackageApi } from '#/api/system/tenant-package';
|
import type { SystemTenantPackageApi } from '#/api/system/tenant-package';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteTenantPackage,
|
deleteTenantPackage,
|
||||||
|
deleteTenantPackageList,
|
||||||
getTenantPackagePage,
|
getTenantPackagePage,
|
||||||
} from '#/api/system/tenant-package';
|
} from '#/api/system/tenant-package';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
@ -54,6 +58,31 @@ async function handleDelete(row: SystemTenantPackageApi.TenantPackage) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemTenantPackageApi.TenantPackage[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除租户套餐 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteTenantPackageList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
formOptions: {
|
formOptions: {
|
||||||
schema: useGridFormSchema(),
|
schema: useGridFormSchema(),
|
||||||
|
|
@ -75,12 +104,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemTenantPackageApi.TenantPackage>,
|
} as VxeTableGridOptions<SystemTenantPackageApi.TenantPackage>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -102,6 +136,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:tenant-package:create'],
|
auth: ['system:tenant-package:create'],
|
||||||
onClick: handleCreate,
|
onClick: handleCreate,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:tenant-package:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,7 @@ export function useGridColumns<T = SystemUserApi.User>(
|
||||||
) => PromiseLike<boolean | undefined>,
|
) => PromiseLike<boolean | undefined>,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
|
{ type: 'checkbox', width: 40 },
|
||||||
{
|
{
|
||||||
field: 'id',
|
field: 'id',
|
||||||
title: '用户编号',
|
title: '用户编号',
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,14 @@ import type { SystemUserApi } from '#/api/system/user';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui';
|
||||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
|
||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import {
|
import {
|
||||||
deleteUser,
|
deleteUser,
|
||||||
|
deleteUserList,
|
||||||
exportUser,
|
exportUser,
|
||||||
getUserPage,
|
getUserPage,
|
||||||
updateUserStatus,
|
updateUserStatus,
|
||||||
|
|
@ -99,6 +100,31 @@ async function handleDelete(row: SystemUserApi.User) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkedIds = ref<number[]>([]);
|
||||||
|
function handleRowCheckboxChange({
|
||||||
|
records,
|
||||||
|
}: {
|
||||||
|
records: SystemUserApi.User[];
|
||||||
|
}) {
|
||||||
|
checkedIds.value = records.map((item) => item.id as number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除用户 */
|
||||||
|
async function handleDeleteBatch() {
|
||||||
|
const hideLoading = message.loading({
|
||||||
|
content: $t('ui.actionMessage.deleting'),
|
||||||
|
duration: 0,
|
||||||
|
key: 'action_process_msg',
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await deleteUserList(checkedIds.value);
|
||||||
|
message.success($t('ui.actionMessage.deleteSuccess'));
|
||||||
|
onRefresh();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 重置密码 */
|
/** 重置密码 */
|
||||||
function handleResetPassword(row: SystemUserApi.User) {
|
function handleResetPassword(row: SystemUserApi.User) {
|
||||||
resetPasswordModalApi.setData(row).open();
|
resetPasswordModalApi.setData(row).open();
|
||||||
|
|
@ -157,12 +183,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: { code: 'query' },
|
refresh: { code: 'query' },
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemUserApi.User>,
|
} as VxeTableGridOptions<SystemUserApi.User>,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxAll: handleRowCheckboxChange,
|
||||||
|
checkboxChange: handleRowCheckboxChange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -214,6 +245,15 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
auth: ['system:user:import'],
|
auth: ['system:user:import'],
|
||||||
onClick: handleImport,
|
onClick: handleImport,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '批量删除',
|
||||||
|
type: 'primary',
|
||||||
|
danger: true,
|
||||||
|
disabled: isEmpty(checkedIds),
|
||||||
|
icon: ACTION_ICON.DELETE,
|
||||||
|
auth: ['system:user:delete'],
|
||||||
|
onClick: handleDeleteBatch,
|
||||||
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue