mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-05 09:01:25 +08:00
refactor: 移除 Modal 组件直接导入,统一使用 window.modal 调用
将项目中直接导入的 antdv-next Modal 组件替换为通过 window.modal 调用,提升代码一致性 删除不再使用的 table-switch.vue 组件
This commit is contained in:
@@ -8,7 +8,7 @@ import { useAccess } from '@vben/access';
|
||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
||||
import { DEFAULT_CLIENT_ID, EnableStatus } from '@vben/constants';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -93,7 +93,7 @@ async function handleDelete(row: Client) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Client) => row.id);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { SysConfig } from '#/api/system/config/model';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -93,7 +93,7 @@ async function handleDelete(row: SysConfig) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: SysConfig) => row.configId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ref } from 'vue';
|
||||
|
||||
import { useVbenDrawer } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -101,7 +101,7 @@ async function handleDelete(row: DictData) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: DictData) => row.dictCode);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -15,14 +15,7 @@ import {
|
||||
PlusOutlined,
|
||||
SyncOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import {
|
||||
Alert,
|
||||
Input,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Space,
|
||||
Tooltip,
|
||||
} from 'antdv-next';
|
||||
import { Alert, Input, Popconfirm, Space, Tooltip } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -121,7 +114,7 @@ function handleDownloadExcel() {
|
||||
}
|
||||
|
||||
function handleRefreshCache() {
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
content: '确认刷新字典类型缓存吗?',
|
||||
okButtonProps: {
|
||||
@@ -171,7 +164,7 @@ watch(searchValue, (value) => {
|
||||
<div
|
||||
:class="
|
||||
cn(
|
||||
'bg-background flex max-h-[100vh] w-[360px] flex-col overflow-y-hidden',
|
||||
'flex max-h-[100vh] w-[360px] flex-col overflow-y-hidden bg-background',
|
||||
'rounded-lg',
|
||||
'dict-type-card',
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -105,7 +105,7 @@ async function handleDelete(row: DictType) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: DictType) => row.dictId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Notice } from '#/api/system/notice/model';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import { noticeList, noticeRemove } from '#/api/system/notice';
|
||||
@@ -82,7 +82,7 @@ async function handleDelete(row: Notice) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Notice) => row.noticeId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useAccess } from '@vben/access';
|
||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
||||
import { EnableStatus } from '@vben/constants';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -89,7 +89,7 @@ async function handleDelete(row: OssConfig) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: OssConfig) => row.ossConfigId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -14,15 +14,7 @@ import { $t } from '@vben/locales';
|
||||
import { stringify } from '@vben/request';
|
||||
import { useAccessStore } from '@vben/stores';
|
||||
|
||||
import {
|
||||
Image,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Space,
|
||||
Spin,
|
||||
Switch,
|
||||
Tooltip,
|
||||
} from 'antdv-next';
|
||||
import { Image, Popconfirm, Space, Spin, Switch, Tooltip } from 'antdv-next';
|
||||
|
||||
import {
|
||||
addSortParams,
|
||||
@@ -166,7 +158,7 @@ async function handleDelete(row: OssFile) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: OssFile) => row.ossId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -107,7 +107,7 @@ async function handleDelete(row: Post) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Post) => row.postId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useRoute } from 'vue-router';
|
||||
|
||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -93,7 +93,7 @@ async function handleAuthCancel(record: User) {
|
||||
function handleMultipleAuthCancel() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: User) => row.userId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认取消选中的${ids.length}条授权记录吗?`,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
SUPERADMIN_ROLE_KEY,
|
||||
} from '@vben/constants';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -108,7 +108,7 @@ async function handleDelete(row: Role) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Role) => row.roleId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { computed } from 'vue';
|
||||
import { useAccess } from '@vben/access';
|
||||
import { Fallback, Page, useVbenDrawer } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -106,7 +106,7 @@ async function handleDelete(row: Tenant) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Tenant) => row.id);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { computed } from 'vue';
|
||||
import { useAccess } from '@vben/access';
|
||||
import { Fallback, Page, useVbenDrawer } from '@vben/common-ui';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -92,7 +92,7 @@ async function handleDelete(row: TenantPackage) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: TenantPackage) => row.packageId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -14,7 +14,7 @@ import { EnableStatus, SUPERADMIN_USER_ID } from '@vben/constants';
|
||||
import { $t } from '@vben/locales';
|
||||
import { preferences } from '@vben/preferences';
|
||||
|
||||
import { Avatar, Dropdown, Modal, Popconfirm, Space } from 'antdv-next';
|
||||
import { Avatar, Dropdown, Popconfirm, Space } from 'antdv-next';
|
||||
|
||||
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||
import {
|
||||
@@ -145,7 +145,7 @@ async function handleDelete(row: User) {
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: User) => row.userId);
|
||||
Modal.confirm({
|
||||
window.modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { h, ref, unref } from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { ExcelIcon, InBoxIcon } from '@vben/icons';
|
||||
|
||||
import { Modal, Switch, Upload } from 'antdv-next';
|
||||
import { Switch, Upload } from 'antdv-next';
|
||||
|
||||
import { downloadImportTemplate, userImportData } from '#/api/system/user';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
@@ -35,11 +35,11 @@ async function handleSubmit() {
|
||||
updateSupport: unref(checked),
|
||||
};
|
||||
const { code, msg } = await userImportData(data);
|
||||
let modal = Modal.success;
|
||||
let modal = window.modal.success;
|
||||
if (code === 200) {
|
||||
emit('reload');
|
||||
} else {
|
||||
modal = Modal.error;
|
||||
modal = window.modal.error;
|
||||
}
|
||||
handleCancel();
|
||||
modal({
|
||||
|
||||
Reference in New Issue
Block a user