reactor:element-plus 移除 loading 的 fullscreen = true(默认就是 true)

This commit is contained in:
YunaiV
2025-09-05 23:39:33 +08:00
parent 8d93c843ad
commit e81a759e0d
58 changed files with 34 additions and 117 deletions

View File

@@ -1,17 +1,12 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemDictDataApi } from '#/api/system/dict/data';
import type { SystemDictTypeApi } from '#/api/system/dict/type';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { useAccess } from '@vben/access';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { z } from '#/adapter/form';
import { getSimpleDictTypeList } from '#/api/system/dict/type';
const { hasAccessByCodes } = useAccess();
// ============================== 字典类型 ==============================
/** 类型新增/修改的表单 */
@@ -83,6 +78,15 @@ export function useTypeGridFormSchema(): VbenFormSchema[] {
clearable: true,
},
},
{
fieldName: 'type',
label: '字典类型',
component: 'Input',
componentProps: {
placeholder: '请输入字典类型',
clearable: true,
},
},
{
fieldName: 'status',
label: '状态',
@@ -97,9 +101,7 @@ export function useTypeGridFormSchema(): VbenFormSchema[] {
}
/** 类型列表的字段 */
export function useTypeGridColumns<T = SystemDictTypeApi.DictType>(
onActionClick: OnActionClickFn<T>,
): VxeTableGridOptions['columns'] {
export function useTypeGridColumns(): VxeTableGridOptions['columns'] {
return [
{ type: 'checkbox', width: 40 },
{
@@ -138,29 +140,10 @@ export function useTypeGridColumns<T = SystemDictTypeApi.DictType>(
formatter: 'formatDateTime',
},
{
minWidth: 120,
title: '操作',
field: 'operation',
minWidth: 120,
fixed: 'right',
align: 'center',
cellRender: {
attrs: {
nameField: 'type',
nameTitle: '字典类型',
onClick: onActionClick,
},
name: 'CellOperation',
options: [
{
code: 'edit',
show: hasAccessByCodes(['system:dict:update']),
},
{
code: 'delete',
show: hasAccessByCodes(['system:dict:delete']),
},
],
},
slots: { default: 'actions' },
},
];
}
@@ -312,9 +295,7 @@ export function useDataGridFormSchema(): VbenFormSchema[] {
/**
* 字典数据表格列
*/
export function useDataGridColumns<T = SystemDictDataApi.DictData>(
onActionClick: OnActionClickFn<T>,
): VxeTableGridOptions['columns'] {
export function useDataGridColumns(): VxeTableGridOptions['columns'] {
return [
{ type: 'checkbox', width: 40 },
{
@@ -363,29 +344,10 @@ export function useDataGridColumns<T = SystemDictDataApi.DictData>(
formatter: 'formatDateTime',
},
{
minWidth: 120,
title: '操作',
field: 'operation',
minWidth: 120,
fixed: 'right',
align: 'center',
cellRender: {
attrs: {
nameField: 'label',
nameTitle: '字典数据',
onClick: onActionClick,
},
name: 'CellOperation',
options: [
{
code: 'edit',
show: hasAccessByCodes(['system:dict:update']),
},
{
code: 'delete',
show: hasAccessByCodes(['system:dict:delete']),
},
],
},
slots: { default: 'actions' },
},
];
}

View File

@@ -8,7 +8,7 @@ import TypeGrid from './modules/type-grid.vue';
const searchDictType = ref<string>(); // 搜索的字典类型
function onDictTypeSelect(dictType: string) {
function handleDictTypeSelect(dictType: string) {
searchDictType.value = dictType;
}
</script>
@@ -22,7 +22,7 @@ function onDictTypeSelect(dictType: string) {
<div class="flex h-full">
<!-- 左侧字典类型列表 -->
<div class="w-1/2 pr-3">
<TypeGrid @select="onDictTypeSelect" />
<TypeGrid @select="handleDictTypeSelect" />
</div>
<!-- 右侧字典数据列表 -->
<div class="w-1/2">

View File

@@ -61,7 +61,6 @@ function onEdit(row: any) {
async function onDelete(row: any) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteDictData(row.id);

View File

@@ -56,7 +56,6 @@ function onEdit(row: any) {
async function onDelete(row: SystemDictTypeApi.DictType) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteDictType(row.id as number);

View File

@@ -47,7 +47,6 @@ function onEdit(row: SystemMailAccountApi.MailAccount) {
async function onDelete(row: SystemMailAccountApi.MailAccount) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.mail]),
fullscreen: true,
});
try {
await deleteMailAccount(row.id as number);

View File

@@ -67,7 +67,6 @@ function onSend(row: SystemMailTemplateApi.MailTemplate) {
async function onDelete(row: SystemMailTemplateApi.MailTemplate) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteMailTemplate(row.id as number);

View File

@@ -49,7 +49,6 @@ function onEdit(row: SystemMenuApi.Menu) {
async function onDelete(row: SystemMenuApi.Menu) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteMenu(row.id as number);

View File

@@ -47,7 +47,6 @@ function onEdit(row: SystemOAuth2ClientApi.OAuth2Client) {
async function onDelete(row: SystemOAuth2ClientApi.OAuth2Client) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteOAuth2Client(row.id as number);

View File

@@ -27,7 +27,6 @@ function onRefresh() {
async function onDelete(row: SystemOAuth2TokenApi.OAuth2Token) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.accessToken]),
fullscreen: true,
});
try {
await deleteOAuth2Token(row.accessToken);

View File

@@ -54,7 +54,6 @@ function onEdit(row: SystemPostApi.Post) {
async function onDelete(row: SystemPostApi.Post) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deletePost(row.id as number);

View File

@@ -68,7 +68,6 @@ function onCreate() {
async function onDelete(row: SystemRoleApi.Role) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteRole(row.id as number);

View File

@@ -54,7 +54,6 @@ function onEdit(row: SystemSmsChannelApi.SmsChannel) {
async function onDelete(row: SystemSmsChannelApi.SmsChannel) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.signature]),
fullscreen: true,
});
try {
await deleteSmsChannel(row.id as number);

View File

@@ -65,7 +65,6 @@ function onSend(row: SystemSmsTemplateApi.SmsTemplate) {
async function onDelete(row: SystemSmsTemplateApi.SmsTemplate) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteSmsTemplate(row.id as number);

View File

@@ -47,7 +47,6 @@ function onEdit(row: SystemSocialClientApi.SocialClient) {
async function onDelete(row: SystemSocialClientApi.SocialClient) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteSocialClient(row.id as number);

View File

@@ -66,7 +66,6 @@ function onEdit(row: SystemTenantApi.Tenant) {
async function onDelete(row: SystemTenantApi.Tenant) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteTenant(row.id as number);

View File

@@ -47,7 +47,6 @@ function onEdit(row: SystemTenantPackageApi.TenantPackage) {
async function onDelete(row: SystemTenantPackageApi.TenantPackage) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.name]),
fullscreen: true,
});
try {
await deleteTenantPackage(row.id as number);

View File

@@ -86,7 +86,6 @@ function onEdit(row: SystemUserApi.User) {
async function onDelete(row: SystemUserApi.User) {
const loadingInstance = ElLoading.service({
text: $t('ui.actionMessage.deleting', [row.username]),
fullscreen: true,
});
try {
await deleteUser(row.id as number);