Pre Merge pull request !185 from 痴货/master
						commit
						f843063d4d
					
				|  | @ -113,6 +113,8 @@ export namespace MallSpuApi { | |||
|     createTime?: Date; | ||||
|     /** 商品状态 */ | ||||
|     status?: number; | ||||
|     /** 浏览量 */ | ||||
|     browseCount?: number; | ||||
|   } | ||||
| 
 | ||||
|   /** 商品状态更新 */ | ||||
|  |  | |||
|  | @ -45,6 +45,8 @@ export namespace MallRewardActivityApi { | |||
|     productCategoryIds?: number[]; | ||||
|     /** 商品 SPU 编号列表(仅表单使用) */ | ||||
|     productSpuIds?: number[]; | ||||
|     /** 状态 */ | ||||
|     status?: number; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -30,13 +30,13 @@ export namespace MallSeckillActivityApi { | |||
|     /** 备注 */ | ||||
|     remark?: string; | ||||
|     /** 开始时间 */ | ||||
|     startTime?: Date; | ||||
|     startTime: Date; | ||||
|     /** 结束时间 */ | ||||
|     endTime?: Date; | ||||
|     endTime: Date; | ||||
|     /** 排序 */ | ||||
|     sort?: number; | ||||
|     /** 配置编号 */ | ||||
|     configIds?: string; | ||||
|     configIds?: number[]; | ||||
|     /** 订单数量 */ | ||||
|     orderCount?: number; | ||||
|     /** 用户数量 */ | ||||
|  |  | |||
|  | @ -38,6 +38,15 @@ const routes: RouteRecordRaw[] = [ | |||
|         }, | ||||
|         component: () => import('#/views/mall/product/spu/modules/detail.vue'), | ||||
|       }, | ||||
|       { | ||||
|         path: '/product/spu', | ||||
|         name: 'ProductSpu', | ||||
|         meta: { | ||||
|           title: '商品列表', | ||||
|           activeMenu: '/mall/product/spu', | ||||
|         }, | ||||
|         component: () => import('#/views/mall/product/spu/index.vue'), | ||||
|       }, | ||||
|     ], | ||||
|   }, | ||||
|   { | ||||
|  |  | |||
|  | @ -9,10 +9,10 @@ import type { InfraDataSourceConfigApi } from '#/api/infra/data-source-config'; | |||
| import { ref } from 'vue'; | ||||
| import { useRouter } from 'vue-router'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -73,23 +73,22 @@ function onEdit(row: InfraCodegenApi.CodegenTable) { | |||
| 
 | ||||
| /** 删除代码生成配置 */ | ||||
| async function onDelete(row: InfraCodegenApi.CodegenTable) { | ||||
|   await ElMessageBox.confirm('确定要删除该代码生成配置吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.tableName]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteCodegenTable(row.id); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.tableName])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteCodegenTable(row.id); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.tableName])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除代码生成配置 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该代码生成配置吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该代码生成配置吗?'); | ||||
|   await deleteCodegenTableList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  | @ -97,11 +96,7 @@ async function onDeleteBatch() { | |||
| 
 | ||||
| /** 同步数据库 */ | ||||
| async function onSync(row: InfraCodegenApi.CodegenTable) { | ||||
|   await ElMessageBox.confirm('确定要同步该代码生成配置吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要同步该代码生成配置吗?'); | ||||
|   await syncCodegenFromDB(row.id); | ||||
|   ElMessage.success($t('ui.actionMessage.updateSuccess', [row.tableName])); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { InfraConfigApi } from '#/api/infra/config'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -52,23 +52,22 @@ function onEdit(row: InfraConfigApi.Config) { | |||
| 
 | ||||
| /** 删除参数 */ | ||||
| async function onDelete(row: InfraConfigApi.Config) { | ||||
|   await ElMessageBox.confirm('确定要删除该参数吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteConfig(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteConfig(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除参数 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该参数吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该参数吗?'); | ||||
|   await deleteConfigList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { InfraDataSourceConfigApi } from '#/api/infra/data-source-config'; | |||
| 
 | ||||
| import { onMounted, ref } from 'vue'; | ||||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -40,23 +40,22 @@ function onEdit(row: InfraDataSourceConfigApi.DataSourceConfig) { | |||
| 
 | ||||
| /** 删除数据源 */ | ||||
| async function onDelete(row: InfraDataSourceConfigApi.DataSourceConfig) { | ||||
|   await ElMessageBox.confirm('确定要删除该数据源吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDataSourceConfig(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDataSourceConfig(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除数据源 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该数据源吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该数据源吗?'); | ||||
|   await deleteDataSourceConfigList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,11 +7,11 @@ import type { InfraFileApi } from '#/api/infra/file'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty, openWindow } from '@vben/utils'; | ||||
| 
 | ||||
| import { useClipboard } from '@vueuse/core'; | ||||
| import { ElButton, ElImage, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElButton, ElImage, ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteFile, deleteFileList, getFilePage } from '#/api/infra/file'; | ||||
|  | @ -60,25 +60,24 @@ function openUrl(url?: string) { | |||
| 
 | ||||
| /** 删除文件 */ | ||||
| async function onDelete(row: InfraFileApi.File) { | ||||
|   await ElMessageBox.confirm('确定要删除该文件吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name || row.path]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteFile(row.id as number); | ||||
|   ElMessage.success( | ||||
|     $t('ui.actionMessage.deleteSuccess', [row.name || row.path]), | ||||
|   ); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteFile(row.id as number); | ||||
|     ElMessage.success( | ||||
|       $t('ui.actionMessage.deleteSuccess', [row.name || row.path]), | ||||
|     ); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除文件 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该文件吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该文件吗?'); | ||||
|   await deleteFileList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ import { ref } from 'vue'; | |||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty, openWindow } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -86,23 +86,22 @@ async function onTest(row: InfraFileConfigApi.FileConfig) { | |||
| 
 | ||||
| /** 删除文件配置 */ | ||||
| async function onDelete(row: InfraFileConfigApi.FileConfig) { | ||||
|   await ElMessageBox.confirm('确定要删除该文件配置吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteFileConfig(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteFileConfig(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除文件配置 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该文件配置吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该文件配置吗?'); | ||||
|   await deleteFileConfigList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ import { useRouter } from 'vue-router'; | |||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -105,23 +105,22 @@ function onLog(row?: InfraJobApi.Job) { | |||
| 
 | ||||
| /** 删除任务 */ | ||||
| async function onDelete(row: InfraJobApi.Job) { | ||||
|   await ElMessageBox.confirm('确定要删除该任务吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteJob(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteJob(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除任务 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该任务吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该任务吗?'); | ||||
|   await deleteJobList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MallBrandApi } from '#/api/mall/product/brand'; | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteBrand, getBrandPage } from '#/api/mall/product/brand'; | ||||
|  | @ -35,15 +35,17 @@ function handleEdit(row: MallBrandApi.Brand) { | |||
| 
 | ||||
| /** 删除品牌 */ | ||||
| async function handleDelete(row: MallBrandApi.Brand) { | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm('确定删除该品牌吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteBrand(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteBrand(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ import { useRouter } from 'vue-router'; | |||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteCategory, getCategoryList } from '#/api/mall/product/category'; | ||||
|  | @ -52,14 +52,17 @@ const handleViewSpu = (id: number) => { | |||
| 
 | ||||
| /** 删除分类 */ | ||||
| async function handleDelete(row: MallCategoryApi.Category) { | ||||
|   await ElMessageBox.confirm('确定删除该分类吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteCategory(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteCategory(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 切换树形展开/收缩状态 */ | ||||
|  | @ -162,8 +165,8 @@ const [Grid, gridApi] = useVbenVxeGrid({ | |||
|               link: true, | ||||
|               icon: ACTION_ICON.VIEW, | ||||
|               auth: ['product:category:update'], | ||||
|               ifShow: row.parentId > 0, | ||||
|               onClick: handleViewSpu.bind(null, row), | ||||
|               ifShow: row.parentId !== undefined && row.parentId > 0, | ||||
|               onClick: handleViewSpu.bind(null, row.id || 0), | ||||
|             }, | ||||
|             { | ||||
|               label: $t('common.delete'), | ||||
|  |  | |||
|  | @ -187,8 +187,8 @@ export function useGridColumns<T = MallCommentApi.Comment>( | |||
|         attrs: { beforeChange: onStatusChange }, | ||||
|         name: 'CellSwitch', | ||||
|         props: { | ||||
|           checkedValue: true, | ||||
|           unCheckedValue: false, | ||||
|           activeValue: true, | ||||
|           inactiveValue: false, | ||||
|         }, | ||||
|       }, | ||||
|     }, | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ import type { MallPropertyApi } from '#/api/mall/product/property'; | |||
| 
 | ||||
| import { useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteProperty, getPropertyPage } from '#/api/mall/product/property'; | ||||
|  | @ -40,14 +40,17 @@ function handleEdit(row: any) { | |||
| 
 | ||||
| /** 删除属性 */ | ||||
| async function handleDelete(row: MallPropertyApi.Property) { | ||||
|   await ElMessageBox.confirm('确定删除该属性吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteProperty(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteProperty(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 表格事件 */ | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ import { watch } from 'vue'; | |||
| 
 | ||||
| import { useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -47,14 +47,17 @@ function handleEdit(row: MallPropertyApi.PropertyValue) { | |||
| 
 | ||||
| /** 删除字典数据 */ | ||||
| async function handleDelete(row: MallPropertyApi.PropertyValue) { | ||||
|   await ElMessageBox.confirm('确定删除该属性值吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deletePropertyValue(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deletePropertyValue(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | |||
| import type { MallSpuApi } from '#/api/mall/product/spu'; | ||||
| 
 | ||||
| import { onMounted, ref } from 'vue'; | ||||
| import { useRouter } from 'vue-router'; | ||||
| import { useRoute, useRouter } from 'vue-router'; | ||||
| 
 | ||||
| import { confirm, DocAlert, Page } from '@vben/common-ui'; | ||||
| import { | ||||
|  | @ -13,7 +13,7 @@ import { | |||
|   treeToString, | ||||
| } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElDescriptions, ElMessage, ElMessageBox, ElTabs } from 'element-plus'; | ||||
| import { ElDescriptions, ElLoading, ElMessage, ElTabs } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { getCategoryList } from '#/api/mall/product/category'; | ||||
|  | @ -31,7 +31,7 @@ import { useGridColumns, useGridFormSchema } from './data'; | |||
| 
 | ||||
| const { push } = useRouter(); | ||||
| const tabType = ref(0); | ||||
| 
 | ||||
| const route = useRoute(); // 路由 | ||||
| const categoryList = ref(); | ||||
| 
 | ||||
| // tabs 数据 | ||||
|  | @ -64,8 +64,9 @@ const tabsData = ref([ | |||
| ]); | ||||
| 
 | ||||
| /** 刷新表格 */ | ||||
| function onRefresh() { | ||||
| async function onRefresh() { | ||||
|   gridApi.query(); | ||||
|   await getTabCount(); | ||||
| } | ||||
| 
 | ||||
| /** 获得每个 Tab 的数量 */ | ||||
|  | @ -97,28 +98,27 @@ function handleEdit(row: MallSpuApi.Spu) { | |||
| 
 | ||||
| /** 删除商品 */ | ||||
| async function handleDelete(row: MallSpuApi.Spu) { | ||||
|   await ElMessageBox.confirm('确定删除该商品吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const hideLoading = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteSpu(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteSpu(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     hideLoading.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 添加到仓库 / 回收站的状态 */ | ||||
| async function handleStatus02Change(row: MallSpuApi.Spu, newStatus: number) { | ||||
|   // 二次确认 | ||||
|   const text = | ||||
|     newStatus === ProductSpuStatusEnum.RECYCLE.status | ||||
|       ? '加入到回收站' | ||||
|       : '恢复到仓库'; | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm(`确认要jian"${row.name}"${text}吗?`, { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm(`确认要"${row.name}"${text}吗?`); | ||||
|   await updateStatus({ id: row.id as number, status: newStatus }); | ||||
|   ElMessage.success(`${text}成功`); | ||||
|   onRefresh(); | ||||
|  | @ -202,11 +202,16 @@ function onChangeTab(key: any) { | |||
|   gridApi.query(); | ||||
| } | ||||
| 
 | ||||
| onMounted(() => { | ||||
|   getTabCount(); | ||||
|   getCategoryList({}).then((res) => { | ||||
|     categoryList.value = handleTree(res, 'id', 'parentId', 'children'); | ||||
|   }); | ||||
| onMounted(async () => { | ||||
|   // 解析路由的 categoryId | ||||
|   if (route.query.categoryId) { | ||||
|     gridApi.formApi.setValues({ | ||||
|       categoryId: Number(route.query.categoryId), | ||||
|     }); | ||||
|   } | ||||
|   await getTabCount(); | ||||
|   const res = await getCategoryList({}); | ||||
|   categoryList.value = handleTree(res, 'id', 'parentId', 'children'); | ||||
| }); | ||||
| </script> | ||||
| 
 | ||||
|  | @ -221,11 +226,12 @@ onMounted(() => { | |||
| 
 | ||||
|     <Grid> | ||||
|       <template #top> | ||||
|         <ElTabs class="border-none" @change="onChangeTab"> | ||||
|         <ElTabs class="border-none" @tab-change="onChangeTab"> | ||||
|           <ElTabs.TabPane | ||||
|             v-for="item in tabsData" | ||||
|             :key="item.type" | ||||
|             :tab="`${item.name} (${item.count})`" | ||||
|             :label="`${item.name} (${item.count})`" | ||||
|             :name="item.type" | ||||
|           /> | ||||
|         </ElTabs> | ||||
|       </template> | ||||
|  | @ -261,23 +267,23 @@ onMounted(() => { | |||
|           :content-style="{ width: '100px', fontSize: '14px' }" | ||||
|         > | ||||
|           <ElDescriptions.Item label="商品分类"> | ||||
|             {{ treeToString(categoryList, row.categoryId) }} | ||||
|             {{ treeToString(categoryList, row.categoryId || 0) }} | ||||
|           </ElDescriptions.Item> | ||||
|           <ElDescriptions.Item label="商品名称"> | ||||
|             {{ row.name }} | ||||
|           </ElDescriptions.Item> | ||||
| 
 | ||||
|           <ElDescriptions.Item label="市场价"> | ||||
|             {{ fenToYuan(row.marketPrice) }} 元 | ||||
|             {{ fenToYuan(row.marketPrice || 0) }} 元 | ||||
|           </ElDescriptions.Item> | ||||
|           <ElDescriptions.Item label="成本价"> | ||||
|             {{ fenToYuan(row.costPrice) }} 元 | ||||
|             {{ fenToYuan(row.costPrice || 0) }} 元 | ||||
|           </ElDescriptions.Item> | ||||
|           <ElDescriptions.Item label="浏览量"> | ||||
|             {{ row.browseCount }} | ||||
|             {{ row.browseCount || 0 }} | ||||
|           </ElDescriptions.Item> | ||||
|           <ElDescriptions.Item label="虚拟销量"> | ||||
|             {{ row.virtualSalesCount }} | ||||
|             {{ row.virtualSalesCount || 0 }} | ||||
|           </ElDescriptions.Item> | ||||
|         </ElDescriptions> | ||||
|       </template> | ||||
|  | @ -305,7 +311,7 @@ onMounted(() => { | |||
|               link: true, | ||||
|               icon: ACTION_ICON.DELETE, | ||||
|               auth: ['product:spu:delete'], | ||||
|               ifShow: () => row.type === 4, | ||||
|               ifShow: () => tabType === 4, | ||||
|               popConfirm: { | ||||
|                 title: $t('ui.actionMessage.deleteConfirm', [row.name]), | ||||
|                 confirm: handleDelete.bind(null, row), | ||||
|  | @ -317,7 +323,7 @@ onMounted(() => { | |||
|               link: true, | ||||
|               icon: ACTION_ICON.EDIT, | ||||
|               auth: ['product:spu:update'], | ||||
|               ifShow: () => row.type === 4, | ||||
|               ifShow: () => tabType === 4, | ||||
|               onClick: handleStatus02Change.bind( | ||||
|                 null, | ||||
|                 row, | ||||
|  | @ -330,7 +336,7 @@ onMounted(() => { | |||
|               link: true, | ||||
|               icon: ACTION_ICON.EDIT, | ||||
|               auth: ['product:spu:update'], | ||||
|               ifShow: () => row.type !== 4, | ||||
|               ifShow: () => tabType !== 4, | ||||
|               onClick: handleStatus02Change.bind( | ||||
|                 null, | ||||
|                 row, | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MallArticleApi } from '#/api/mall/promotion/article'; | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteArticle, getArticlePage } from '#/api/mall/promotion/article'; | ||||
|  | @ -35,14 +35,17 @@ function handleEdit(row: MallArticleApi.Article) { | |||
| 
 | ||||
| /** 删除品牌 */ | ||||
| async function handleDelete(row: MallArticleApi.Article) { | ||||
|   await ElMessageBox.confirm('确定删除该文章吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.title]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteArticle(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.title])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteArticle(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.title])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MallBannerApi } from '#/api/mall/market/banner'; | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteBanner, getBannerPage } from '#/api/mall/market/banner'; | ||||
|  | @ -35,14 +35,17 @@ function handleEdit(row: MallBannerApi.Banner) { | |||
| 
 | ||||
| /** 删除Banner */ | ||||
| async function handleDelete(row: MallBannerApi.Banner) { | ||||
|   await ElMessageBox.confirm('确定删除该Banner吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.title]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteBanner(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.title])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteBanner(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.title])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -2,9 +2,9 @@ | |||
| import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | ||||
| import type { MallBargainActivityApi } from '#/api/mall/promotion/bargain/bargainActivity'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -41,11 +41,7 @@ function handleEdit(row: MallBargainActivityApi.BargainActivity) { | |||
| 
 | ||||
| /** 关闭砍价活动 */ | ||||
| async function handleClose(row: MallBargainActivityApi.BargainActivity) { | ||||
|   await ElMessageBox.confirm('确定关闭该砍价活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定关闭该砍价活动吗?'); | ||||
|   await closeBargainActivity(row.id as number); | ||||
|   ElMessage.success('关闭成功'); | ||||
|   onRefresh(); | ||||
|  | @ -53,14 +49,17 @@ async function handleClose(row: MallBargainActivityApi.BargainActivity) { | |||
| 
 | ||||
| /** 删除砍价活动 */ | ||||
| async function handleDelete(row: MallBargainActivityApi.BargainActivity) { | ||||
|   await ElMessageBox.confirm('确定删除该砍价活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteBargainActivity(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteBargainActivity(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -2,9 +2,9 @@ | |||
| import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | ||||
| import type { MallCombinationActivityApi } from '#/api/mall/promotion/combination/combinationActivity'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -43,12 +43,7 @@ function handleEdit(row: MallCombinationActivityApi.CombinationActivity) { | |||
| async function handleClose( | ||||
|   row: MallCombinationActivityApi.CombinationActivity, | ||||
| ) { | ||||
|   await ElMessageBox.confirm('确定关闭该拼团活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
| 
 | ||||
|   await confirm('确定关闭该拼团活动吗?'); | ||||
|   await closeCombinationActivity(row.id as number); | ||||
|   ElMessage.success('关闭成功'); | ||||
|   onRefresh(); | ||||
|  | @ -58,15 +53,17 @@ async function handleClose( | |||
| async function handleDelete( | ||||
|   row: MallCombinationActivityApi.CombinationActivity, | ||||
| ) { | ||||
|   await ElMessageBox.confirm('确定删除该拼团活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
| 
 | ||||
|   await deleteCombinationActivity(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteCombinationActivity(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -6,13 +6,14 @@ import { ref } from 'vue'; | |||
| 
 | ||||
| import { DocAlert, Page } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|   deleteCoupon, | ||||
|   getCouponPage, | ||||
| } from '#/api/mall/promotion/coupon/coupon'; | ||||
| import { $t } from '#/locales'; | ||||
| 
 | ||||
| import { getStatusTabs, useGridColumns, useGridFormSchema } from './data'; | ||||
| 
 | ||||
|  | @ -23,14 +24,17 @@ const statusTabs = ref(getStatusTabs()); | |||
| 
 | ||||
| /** 删除优惠券 */ | ||||
| async function handleDelete(row: MallCouponApi.Coupon) { | ||||
|   await ElMessageBox.confirm('确定回收该优惠券吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteCoupon(row.id as number); | ||||
|   ElMessage.success('回收成功'); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteCoupon(row.id as number); | ||||
|     ElMessage.success('回收成功'); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 刷新表格 */ | ||||
|  |  | |||
|  | @ -2,9 +2,9 @@ | |||
| import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | ||||
| import type { MallDiscountActivityApi } from '#/api/mall/promotion/discount/discountActivity'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -41,12 +41,7 @@ function handleEdit(row: MallDiscountActivityApi.DiscountActivity) { | |||
| 
 | ||||
| /** 关闭满减活动 */ | ||||
| async function handleClose(row: MallDiscountActivityApi.DiscountActivity) { | ||||
|   await ElMessageBox.confirm('确定关闭该限时折扣活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
| 
 | ||||
|   await confirm('确定关闭该限时折扣活动吗?'); | ||||
|   await closeDiscountActivity(row.id as number); | ||||
|   ElMessage.success('关闭成功'); | ||||
|   onRefresh(); | ||||
|  | @ -54,15 +49,17 @@ async function handleClose(row: MallDiscountActivityApi.DiscountActivity) { | |||
| 
 | ||||
| /** 删除满减活动 */ | ||||
| async function handleDelete(row: MallDiscountActivityApi.DiscountActivity) { | ||||
|   await ElMessageBox.confirm('确定删除该限时折扣活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
| 
 | ||||
|   await deleteDiscountActivity(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDiscountActivity(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ import { useRouter } from 'vue-router'; | |||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteDiyPage, getDiyPagePage } from '#/api/mall/promotion/diy/page'; | ||||
|  | @ -47,14 +47,17 @@ function handleDecorate(row: MallDiyPageApi.DiyPage) { | |||
| 
 | ||||
| /** 删除DIY页面 */ | ||||
| async function handleDelete(row: MallDiyPageApi.DiyPage) { | ||||
|   await ElMessageBox.confirm('确定删除该装修页面吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDiyPage(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDiyPage(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,9 +4,9 @@ import type { MallDiyTemplateApi } from '#/api/mall/promotion/diy/template'; | |||
| 
 | ||||
| import { useRouter } from 'vue-router'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -51,11 +51,7 @@ function handleDecorate(row: MallDiyTemplateApi.DiyTemplate) { | |||
| 
 | ||||
| /** 使用模板 */ | ||||
| async function handleUse(row: MallDiyTemplateApi.DiyTemplate) { | ||||
|   await ElMessageBox.confirm(`是否使用模板"${row.name}"?`, { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm(`是否使用模板"${row.name}"?`); | ||||
|   // 发起删除 | ||||
|   await useDiyTemplate(row.id as number); | ||||
|   ElMessage.success('使用成功'); | ||||
|  | @ -64,14 +60,17 @@ async function handleUse(row: MallDiyTemplateApi.DiyTemplate) { | |||
| 
 | ||||
| /** 删除DIY模板 */ | ||||
| async function handleDelete(row: MallDiyTemplateApi.DiyTemplate) { | ||||
|   await ElMessageBox.confirm('确定删除该装修模板吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDiyTemplate(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDiyTemplate(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| import type { VbenFormSchema } from '#/adapter/form'; | ||||
| import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | ||||
| 
 | ||||
| import { DICT_TYPE } from '#/utils/dict'; | ||||
| import { DICT_TYPE, getDictOptions } from '#/utils/dict'; | ||||
| 
 | ||||
| /** 表单配置 */ | ||||
| export function useFormSchema(): VbenFormSchema[] { | ||||
|  | @ -55,7 +55,7 @@ export function useGridFormSchema(): VbenFormSchema[] { | |||
|       componentProps: { | ||||
|         placeholder: '请选择活动状态', | ||||
|         clearable: true, | ||||
|         dictType: DICT_TYPE.COMMON_STATUS, | ||||
|         options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), | ||||
|       }, | ||||
|     }, | ||||
|   ]; | ||||
|  |  | |||
|  | @ -4,9 +4,9 @@ import type { MallPointActivityApi } from '#/api/mall/promotion/point'; | |||
| 
 | ||||
| import { computed } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -49,11 +49,7 @@ function handleEdit(row: MallPointActivityApi.PointActivity) { | |||
| 
 | ||||
| /** 关闭积分活动 */ | ||||
| async function handleClose(row: MallPointActivityApi.PointActivity) { | ||||
|   await ElMessageBox.confirm('确认关闭该积分商城活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确认关闭该积分商城活动吗?'); | ||||
|   await closePointActivity(row.id); | ||||
|   ElMessage.success('关闭成功'); | ||||
|   onRefresh(); | ||||
|  | @ -61,13 +57,16 @@ async function handleClose(row: MallPointActivityApi.PointActivity) { | |||
| 
 | ||||
| /** 删除积分活动 */ | ||||
| async function handleDelete(row: MallPointActivityApi.PointActivity) { | ||||
|   await ElMessageBox.confirm('确定删除该积分商城活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.spuName]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deletePointActivity(row.id); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deletePointActivity(row.id); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -2,9 +2,9 @@ | |||
| import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | ||||
| import type { MallRewardActivityApi } from '#/api/mall/promotion/reward/rewardActivity'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -41,12 +41,7 @@ function handleEdit(row: MallRewardActivityApi.RewardActivity) { | |||
| 
 | ||||
| /** 关闭活动 */ | ||||
| async function handleClose(row: MallRewardActivityApi.RewardActivity) { | ||||
|   await ElMessageBox.confirm('确认关闭该满减送活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
| 
 | ||||
|   await confirm('确认关闭该满减送活动吗?'); | ||||
|   await closeRewardActivity(row.id as number); | ||||
|   ElMessage.success('关闭成功'); | ||||
|   onRefresh(); | ||||
|  | @ -54,14 +49,17 @@ async function handleClose(row: MallRewardActivityApi.RewardActivity) { | |||
| 
 | ||||
| /** 删除活动 */ | ||||
| async function handleDelete(row: MallRewardActivityApi.RewardActivity) { | ||||
|   await ElMessageBox.confirm('确定删除该满减送活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteRewardActivity(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteRewardActivity(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,10 +4,10 @@ import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckil | |||
| 
 | ||||
| import { onMounted } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { $t } from '@vben/locales'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox, ElTag } from 'element-plus'; | ||||
| import { ElLoading, ElMessage, ElTag } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -45,11 +45,7 @@ function handleCreate() { | |||
| 
 | ||||
| /** 关闭活动 */ | ||||
| async function handleClose(row: MallSeckillActivityApi.SeckillActivity) { | ||||
|   await ElMessageBox.confirm('确认关闭该秒杀活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确认关闭该秒杀活动吗?'); | ||||
|   await closeSeckillActivity(row.id as number); | ||||
|   ElMessage.success('关闭成功'); | ||||
|   onRefresh(); | ||||
|  | @ -57,14 +53,17 @@ async function handleClose(row: MallSeckillActivityApi.SeckillActivity) { | |||
| 
 | ||||
| /** 删除活动 */ | ||||
| async function handleDelete(row: MallSeckillActivityApi.SeckillActivity) { | ||||
|   await ElMessageBox.confirm('确定删除该秒杀活动吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteSeckillActivity(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteSeckillActivity(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  | @ -86,6 +85,9 @@ const [Grid, gridApi] = useVbenVxeGrid({ | |||
|         }, | ||||
|       }, | ||||
|     }, | ||||
|     cellConfig: { | ||||
|       height: 250, | ||||
|     }, | ||||
|     rowConfig: { | ||||
|       keyField: 'id', | ||||
|       isHover: true, | ||||
|  | @ -163,10 +165,7 @@ onMounted(async () => { | |||
|               link: true, | ||||
|               auth: ['promotion:seckill-activity:close'], | ||||
|               ifShow: row.status === 0, | ||||
|               popConfirm: { | ||||
|                 title: '确认关闭该秒杀活动吗?', | ||||
|                 confirm: handleClose.bind(null, row), | ||||
|               }, | ||||
|               onClick: handleClose.bind(null, row), | ||||
|             }, | ||||
|             { | ||||
|               label: $t('common.delete'), | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MallSeckillConfigApi } from '#/api/mall/promotion/seckill/seckillC | |||
| 
 | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -39,14 +39,17 @@ function handleEdit(row: MallSeckillConfigApi.SeckillConfig) { | |||
| 
 | ||||
| /** 删除秒杀时段 */ | ||||
| async function handleDelete(row: MallSeckillConfigApi.SeckillConfig) { | ||||
|   await ElMessageBox.confirm('确定删除该秒杀时段吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteSeckillConfig(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteSeckillConfig(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 修改状态 */ | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ import type { AnalysisOverviewIconItem } from '#/views/mall/home/components/data | |||
| 
 | ||||
| import { reactive, ref } from 'vue'; | ||||
| 
 | ||||
| import { confirm } from '@vben/common-ui'; | ||||
| import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; | ||||
| import { | ||||
|   calculateRelativeRate, | ||||
|  | @ -17,7 +18,6 @@ import { | |||
| } from '@vben/utils'; | ||||
| 
 | ||||
| import dayjs from 'dayjs'; | ||||
| import { ElMessageBox } from 'element-plus'; | ||||
| 
 | ||||
| import * as TradeStatisticsApi from '#/api/mall/statistics/trade'; | ||||
| import AnalysisChartCard from '#/views/mall/home/components/analysis-chart-card.vue'; | ||||
|  | @ -142,7 +142,7 @@ const loadOverview = () => { | |||
| const handleExport = async () => { | ||||
|   try { | ||||
|     // 导出的二次确认 | ||||
|     await ElMessageBox.confirm('确定要导出交易状况吗?'); | ||||
|     await confirm('确定要导出交易状况吗?'); | ||||
|     // 发起导出 | ||||
|     exportLoading.value = true; | ||||
|     const times = shortcutDateRangePicker.value.times; | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ import type { MallOrderApi } from '#/api/mall/trade/order'; | |||
| import { onMounted, ref } from 'vue'; | ||||
| import { useRoute, useRouter } from 'vue-router'; | ||||
| 
 | ||||
| import { Page } from '@vben/common-ui'; | ||||
| import { confirm, Page } from '@vben/common-ui'; | ||||
| import { $t } from '@vben/locales'; | ||||
| import { fenToYuan, formatDate } from '@vben/utils'; | ||||
| 
 | ||||
|  | @ -14,7 +14,6 @@ import { | |||
|   ElDescriptionsItem, | ||||
|   ElImage, | ||||
|   ElMessage, | ||||
|   ElMessageBox, | ||||
|   ElTimeline, | ||||
|   ElTimelineItem, | ||||
| } from 'element-plus'; | ||||
|  | @ -74,11 +73,7 @@ const getDetail = async () => { | |||
| /** 同意售后 */ | ||||
| const agree = async () => { | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm('是否同意售后?', '提示', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('是否同意售后?'); | ||||
|   await AfterSaleApi.agree(formData.value.id!); | ||||
|   // 提示成功 | ||||
|   ElMessage.success($t('page.common.success')); | ||||
|  | @ -93,11 +88,7 @@ const disagree = async () => { | |||
| /** 确认收货 */ | ||||
| const receive = async () => { | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm('是否确认收货?', '提示', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('是否确认收货?'); | ||||
|   await AfterSaleApi.receive(formData.value.id!); | ||||
|   // 提示成功 | ||||
|   ElMessage.success($t('page.common.success')); | ||||
|  | @ -107,11 +98,7 @@ const receive = async () => { | |||
| /** 拒绝收货 */ | ||||
| const refuse = async () => { | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm('是否拒绝收货?', '提示', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('是否拒绝收货?'); | ||||
|   await AfterSaleApi.refuse(formData.value.id!); | ||||
|   // 提示成功 | ||||
|   ElMessage.success($t('page.common.success')); | ||||
|  | @ -121,11 +108,7 @@ const refuse = async () => { | |||
| /** 确认退款 */ | ||||
| const refund = async () => { | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm('是否确认退款?', '提示', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('是否确认退款?'); | ||||
|   await AfterSaleApi.refund(formData.value.id!); | ||||
|   // 提示成功 | ||||
|   ElMessage.success($t('page.common.success')); | ||||
|  |  | |||
|  | @ -3,10 +3,10 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | |||
| import type { MallBrokerageUserApi } from '#/api/mall/trade/brokerage/user'; | ||||
| 
 | ||||
| import { useAccess } from '@vben/access'; | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { $t } from '@vben/locales'; | ||||
| 
 | ||||
| import { ElLoading, ElMessage, ElMessageBox, ElSwitch } from 'element-plus'; | ||||
| import { ElLoading, ElMessage, ElSwitch } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -68,11 +68,7 @@ function openCreateUserForm() { | |||
| 
 | ||||
| /** 清除上级推广人 */ | ||||
| async function handleClearBindUser(row: MallBrokerageUserApi.BrokerageUser) { | ||||
|   await ElMessageBox.confirm(`确定清除"${row.nickname}"的上级推广人吗?`, { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm(`确定清除"${row.nickname}"的上级推广人吗?`); | ||||
|   await clearBindUser({ id: row.id as number }); | ||||
|   ElMessage.success('清除成功'); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -4,10 +4,10 @@ import type { MallBrokerageWithdrawApi } from '#/api/mall/trade/brokerage/withdr | |||
| 
 | ||||
| import { h } from 'vue'; | ||||
| 
 | ||||
| import { Page, prompt } from '@vben/common-ui'; | ||||
| import { confirm, Page, prompt } from '@vben/common-ui'; | ||||
| import { formatDateTime } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElInput, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElInput, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -35,11 +35,7 @@ function onRefresh() { | |||
| 
 | ||||
| /** 审核通过 */ | ||||
| async function handleApprove(row: MallBrokerageWithdrawApi.BrokerageWithdraw) { | ||||
|   await ElMessageBox.confirm('确定要审核通过吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要审核通过吗?'); | ||||
|   await approveBrokerageWithdraw(row.id); | ||||
|   ElMessage.success($t('ui.actionMessage.operationSuccess')); | ||||
|   onRefresh(); | ||||
|  | @ -73,11 +69,7 @@ function handleReject(row: MallBrokerageWithdrawApi.BrokerageWithdraw) { | |||
| async function handleRetryTransfer( | ||||
|   row: MallBrokerageWithdrawApi.BrokerageWithdraw, | ||||
| ) { | ||||
|   await ElMessageBox.confirm('确定要重新转账吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要重新转账吗?'); | ||||
|   await approveBrokerageWithdraw(row.id); | ||||
|   ElMessage.success($t('ui.actionMessage.operationSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -26,9 +26,13 @@ export function useFormSchema(): VbenFormSchema[] { | |||
|       label: '退款理由', | ||||
|       component: 'Select', | ||||
|       componentProps: { | ||||
|         mode: 'tags', | ||||
|         placeholder: '请直接输入退款理由', | ||||
|         multiple: true, | ||||
|         options: [], | ||||
|         class: 'w-full', | ||||
|         allowCreate: true, | ||||
|         filterable: true, | ||||
|         reserveKeyword: false, | ||||
|       }, | ||||
|       dependencies: { | ||||
|         triggerFields: ['type'], | ||||
|  | @ -40,9 +44,13 @@ export function useFormSchema(): VbenFormSchema[] { | |||
|       label: '退货理由', | ||||
|       component: 'Select', | ||||
|       componentProps: { | ||||
|         mode: 'tags', | ||||
|         placeholder: '请直接输入退货理由', | ||||
|         multiple: true, | ||||
|         options: [], | ||||
|         class: 'w-full', | ||||
|         allowCreate: true, | ||||
|         filterable: true, | ||||
|         reserveKeyword: false, | ||||
|       }, | ||||
|       dependencies: { | ||||
|         triggerFields: ['type'], | ||||
|  |  | |||
|  | @ -59,10 +59,6 @@ onMounted(() => { | |||
| }); | ||||
| 
 | ||||
| const [Form, formApi] = useVbenForm({ | ||||
|   commonConfig: { | ||||
|     // 所有表单项 | ||||
|     labelClass: 'w-2/6', | ||||
|   }, | ||||
|   wrapperClass: 'grid-cols-1', | ||||
|   actionWrapperClass: 'text-center', | ||||
|   handleSubmit: onSubmit, | ||||
|  | @ -75,7 +71,7 @@ const [Form, formApi] = useVbenForm({ | |||
| </script> | ||||
| 
 | ||||
| <template> | ||||
|   <Page> | ||||
|   <Page auto-content-height> | ||||
|     <template #doc> | ||||
|       <DocAlert | ||||
|         title="【交易】交易订单" | ||||
|  | @ -86,11 +82,11 @@ const [Form, formApi] = useVbenForm({ | |||
|         url="https://doc.iocoder.cn/mall/trade-cart/" | ||||
|       /> | ||||
|     </template> | ||||
|     <ElCard> | ||||
|       <ElTabs :active-key="activeKey" @change="handleTabChange"> | ||||
|         <ElTabPane tab="售后" key="afterSale" :force-render="true" /> | ||||
|         <ElTabPane tab="配送" key="delivery" :force-render="true" /> | ||||
|         <ElTabPane tab="分销" key="brokerage" :force-render="true" /> | ||||
|     <ElCard class="h-full"> | ||||
|       <ElTabs v-model="activeKey" @tab-change="handleTabChange"> | ||||
|         <ElTabPane label="售后" name="afterSale" :force-render="true" /> | ||||
|         <ElTabPane label="配送" name="delivery" :force-render="true" /> | ||||
|         <ElTabPane label="分销" name="brokerage" :force-render="true" /> | ||||
|       </ElTabs> | ||||
|       <Form class="w-3/5" /> | ||||
|     </ElCard> | ||||
|  |  | |||
|  | @ -5,7 +5,7 @@ import type { MallDeliveryExpressApi } from '#/api/mall/trade/delivery/express'; | |||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -46,14 +46,17 @@ function handleEdit(row: MallDeliveryExpressApi.DeliveryExpress) { | |||
| 
 | ||||
| /** 删除快递公司 */ | ||||
| async function handleDelete(row: MallDeliveryExpressApi.DeliveryExpress) { | ||||
|   await ElMessageBox.confirm($t('ui.actionMessage.deleting', [row.name]), { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDeliveryExpress(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDeliveryExpress(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MallDeliveryExpressTemplateApi } from '#/api/mall/trade/delivery/e | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -40,14 +40,17 @@ function handleEdit(row: MallDeliveryExpressTemplateApi.ExpressTemplate) { | |||
| async function handleDelete( | ||||
|   row: MallDeliveryExpressTemplateApi.ExpressTemplate, | ||||
| ) { | ||||
|   await ElMessageBox.confirm($t('ui.actionMessage.deleting', [row.name]), { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDeliveryExpressTemplate(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDeliveryExpressTemplate(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MallDeliveryPickUpStoreApi } from '#/api/mall/trade/delivery/pickU | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -49,14 +49,17 @@ function handleBind(row: MallDeliveryPickUpStoreApi.PickUpStore) { | |||
| 
 | ||||
| /** 删除门店 */ | ||||
| async function handleDelete(row: MallDeliveryPickUpStoreApi.PickUpStore) { | ||||
|   await ElMessageBox.confirm('确定要删除该门店吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDeliveryPickUpStore(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDeliveryPickUpStore(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -117,7 +117,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ | |||
|         <div class="order-items"> | ||||
|           <div v-for="item in row.items" :key="item.id" class="order-item"> | ||||
|             <div class="order-item-image"> | ||||
|               <ElImage :src="item.picUrl" :width="40" :height="40" /> | ||||
|               <ElImage :src="item.picUrl" class="h-40 w-40" /> | ||||
|             </div> | ||||
|             <div class="order-item-content"> | ||||
|               <div class="order-item-name"> | ||||
|  | @ -131,11 +131,11 @@ const [Grid, gridApi] = useVbenVxeGrid({ | |||
|                 </ElTag> | ||||
|               </div> | ||||
|               <div class="order-item-info"> | ||||
|                 <span | ||||
|                   >原价:{{ fenToYuan(item.price) }} 元 / 数量:{{ | ||||
|                 <span> | ||||
|                   原价:{{ fenToYuan(item.price) }} 元 / 数量:{{ | ||||
|                     item.count | ||||
|                   }}个</span | ||||
|                 > | ||||
|                   }}个 | ||||
|                 </span> | ||||
|                 <DictTag | ||||
|                   :type="DICT_TYPE.TRADE_ORDER_ITEM_AFTER_SALE_STATUS" | ||||
|                   :value="item.afterSaleStatus" | ||||
|  |  | |||
|  | @ -6,14 +6,13 @@ import type { MallOrderApi } from '#/api/mall/trade/order'; | |||
| import { onMounted, ref } from 'vue'; | ||||
| import { useRoute, useRouter } from 'vue-router'; | ||||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { fenToYuan, formatDate } from '@vben/utils'; | ||||
| 
 | ||||
| import { | ||||
|   ElDescriptions, | ||||
|   ElDescriptionsItem, | ||||
|   ElMessage, | ||||
|   ElMessageBox, | ||||
|   ElTimeline, | ||||
|   ElTimelineItem, | ||||
| } from 'element-plus'; | ||||
|  | @ -109,12 +108,7 @@ const updatePrice = () => { | |||
| /** 核销 */ | ||||
| const handlePickUp = async () => { | ||||
|   // 二次确认 | ||||
|   await ElMessageBox.confirm('确认核销订单吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   // 提交 | ||||
|   await confirm(`确认核销订单吗?`); | ||||
|   await TradeOrderApi.pickUpOrder(formData.value.id!); | ||||
|   ElMessage.success('核销成功'); | ||||
|   // 刷新列表 | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MemberGroupApi } from '#/api/member/group'; | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteGroup, getGroupPage } from '#/api/member/group'; | ||||
|  | @ -35,14 +35,17 @@ function handleEdit(row: MemberGroupApi.Group) { | |||
| 
 | ||||
| /** 删除分组 */ | ||||
| async function handleDelete(row: MemberGroupApi.Group) { | ||||
|   await ElMessageBox.confirm('确定要删除该分组吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteGroup(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteGroup(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MemberLevelApi } from '#/api/member/level'; | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteLevel, getLevelList } from '#/api/member/level'; | ||||
|  | @ -35,14 +35,17 @@ function handleEdit(row: MemberLevelApi.Level) { | |||
| 
 | ||||
| /** 删除等级 */ | ||||
| async function handleDelete(row: MemberLevelApi.Level) { | ||||
|   await ElMessageBox.confirm('确定要删除该等级吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteLevel(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteLevel(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { MemberTagApi } from '#/api/member/tag'; | |||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteMemberTag, getMemberTagPage } from '#/api/member/tag'; | ||||
|  | @ -35,14 +35,17 @@ function handleEdit(row: MemberTagApi.Tag) { | |||
| 
 | ||||
| /** 删除会员标签 */ | ||||
| async function handleDelete(row: MemberTagApi.Tag) { | ||||
|   await ElMessageBox.confirm('确定要删除该会员标签吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteMemberTag(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteMemberTag(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ import type { PayAppApi } from '#/api/pay/app/index'; | |||
| 
 | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { changeAppStatus, deleteApp, getAppPage } from '#/api/pay/app/index'; | ||||
|  | @ -39,14 +39,17 @@ function handleEdit(row: Required<PayAppApi.App>) { | |||
| } | ||||
| 
 | ||||
| async function handleDelete(row: Required<PayAppApi.App>) { | ||||
|   await ElMessageBox.confirm('确定要删除该应用吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteApp(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteApp(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 更新状态 */ | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; | |||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -37,14 +37,17 @@ function handleEdit(row: any) { | |||
| 
 | ||||
| /** 删除套餐 */ | ||||
| async function handleDelete(row: any) { | ||||
|   await ElMessageBox.confirm('确定要删除该充值套餐吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deletePackage(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deletePackage(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| const [Grid, gridApi] = useVbenVxeGrid({ | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ import { onMounted, ref } from 'vue'; | |||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { Plus } from '@vben/icons'; | ||||
| 
 | ||||
| import { ElButton, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElButton, ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteDept, getDeptList } from '#/api/system/dept'; | ||||
|  | @ -62,14 +62,17 @@ function onEdit(row: SystemDeptApi.Dept) { | |||
| 
 | ||||
| /** 删除部门 */ | ||||
| async function onDelete(row: SystemDeptApi.Dept) { | ||||
|   await ElMessageBox.confirm('确定要删除该部门吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDept(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDept(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 表格操作按钮的回调函数 */ | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemDictDataApi } from '#/api/system/dict/data'; | |||
| 
 | ||||
| import { ref, watch } from 'vue'; | ||||
| 
 | ||||
| import { useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -59,23 +59,22 @@ function onEdit(row: any) { | |||
| 
 | ||||
| /** 删除字典数据 */ | ||||
| async function onDelete(row: any) { | ||||
|   await ElMessageBox.confirm('确定要删除该字典数据吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDictData(row.id); | ||||
|   ElMessage.success($t('common.operationSuccess')); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDictData(row.id); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除字典数据 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该字典数据吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该字典数据吗?'); | ||||
|   await deleteDictDataList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemDictTypeApi } from '#/api/system/dict/type'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -54,23 +54,22 @@ function onEdit(row: any) { | |||
| 
 | ||||
| /** 删除字典类型 */ | ||||
| async function onDelete(row: SystemDictTypeApi.DictType) { | ||||
|   await ElMessageBox.confirm('确定要删除该字典类型吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteDictType(row.id as number); | ||||
|   ElMessage.success($t('common.operationSuccess')); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteDictType(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除字典类型 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该字典类型吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该字典类型吗?'); | ||||
|   await deleteDictTypeList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemMailAccountApi } from '#/api/system/mail/account'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -45,23 +45,22 @@ function onEdit(row: SystemMailAccountApi.MailAccount) { | |||
| 
 | ||||
| /** 删除邮箱账号 */ | ||||
| async function onDelete(row: SystemMailAccountApi.MailAccount) { | ||||
|   await ElMessageBox.confirm('确定要删除该邮箱账号吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.mail]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteMailAccount(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.mail])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteMailAccount(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.mail])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除邮箱账号 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该邮箱账号吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该邮箱账号吗?'); | ||||
|   await deleteMailAccountList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -8,10 +8,10 @@ import type { SystemMailTemplateApi } from '#/api/system/mail/template'; | |||
| 
 | ||||
| import { onMounted, ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { getSimpleMailAccountList } from '#/api/system/mail/account'; | ||||
|  | @ -65,23 +65,22 @@ function onSend(row: SystemMailTemplateApi.MailTemplate) { | |||
| 
 | ||||
| /** 删除邮件模板 */ | ||||
| async function onDelete(row: SystemMailTemplateApi.MailTemplate) { | ||||
|   await ElMessageBox.confirm('确定要删除该邮件模板吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteMailTemplate(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteMailTemplate(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除邮件模板 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该邮件模板吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该邮件模板吗?'); | ||||
|   await deleteMailTemplateList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ import { ref } from 'vue'; | |||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { IconifyIcon, Plus } from '@vben/icons'; | ||||
| 
 | ||||
| import { ElButton, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElButton, ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { deleteMenu, getMenuList } from '#/api/system/menu'; | ||||
|  | @ -47,14 +47,17 @@ function onEdit(row: SystemMenuApi.Menu) { | |||
| 
 | ||||
| /** 删除菜单 */ | ||||
| async function onDelete(row: SystemMenuApi.Menu) { | ||||
|   await ElMessageBox.confirm('确定要删除该菜单吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteMenu(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteMenu(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 表格操作按钮的回调函数 */ | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemNoticeApi } from '#/api/system/notice'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -46,23 +46,22 @@ function onEdit(row: SystemNoticeApi.Notice) { | |||
| 
 | ||||
| /** 删除公告 */ | ||||
| async function onDelete(row: SystemNoticeApi.Notice) { | ||||
|   await ElMessageBox.confirm('确定要删除该公告吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.title]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteNotice(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.title])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteNotice(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.title])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除公告 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该公告吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该公告吗?'); | ||||
|   await deleteNoticeList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemOAuth2ClientApi } from '#/api/system/oauth2/client'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -45,23 +45,22 @@ function onEdit(row: SystemOAuth2ClientApi.OAuth2Client) { | |||
| 
 | ||||
| /** 删除 OAuth2 客户端 */ | ||||
| async function onDelete(row: SystemOAuth2ClientApi.OAuth2Client) { | ||||
|   await ElMessageBox.confirm('确定要删除该 OAuth2 客户端吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteOAuth2Client(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteOAuth2Client(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除 OAuth2 客户端 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该 OAuth2 客户端吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该 OAuth2 客户端吗?'); | ||||
|   await deleteOAuth2ClientList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ import type { SystemOAuth2TokenApi } from '#/api/system/oauth2/token'; | |||
| 
 | ||||
| import { DocAlert, Page } from '@vben/common-ui'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -25,14 +25,17 @@ function onRefresh() { | |||
| 
 | ||||
| /** 删除 OAuth2 令牌 */ | ||||
| async function onDelete(row: SystemOAuth2TokenApi.OAuth2Token) { | ||||
|   await ElMessageBox.confirm('确定要删除该令牌吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.accessToken]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteOAuth2Token(row.accessToken); | ||||
|   ElMessage.success($t('ui.actionMessage.operationSuccess')); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteOAuth2Token(row.accessToken); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.accessToken])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 表格操作按钮的回调函数 */ | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemPostApi } from '#/api/system/post'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -52,23 +52,22 @@ function onEdit(row: SystemPostApi.Post) { | |||
| 
 | ||||
| /** 删除岗位 */ | ||||
| async function onDelete(row: SystemPostApi.Post) { | ||||
|   await ElMessageBox.confirm('确定要删除该岗位吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deletePost(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deletePost(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除岗位 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该岗位吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该岗位吗?'); | ||||
|   await deletePostList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,11 +7,11 @@ import type { SystemRoleApi } from '#/api/system/role'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { Download, Plus } from '@vben/icons'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElButton, ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElButton, ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -66,23 +66,22 @@ function onCreate() { | |||
| 
 | ||||
| /** 删除角色 */ | ||||
| async function onDelete(row: SystemRoleApi.Role) { | ||||
|   await ElMessageBox.confirm('确定要删除该角色吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteRole(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteRole(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除角色 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该角色吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该角色吗?'); | ||||
|   await deleteRoleList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemSmsChannelApi } from '#/api/system/sms/channel'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -52,23 +52,22 @@ function onEdit(row: SystemSmsChannelApi.SmsChannel) { | |||
| 
 | ||||
| /** 删除短信渠道 */ | ||||
| async function onDelete(row: SystemSmsChannelApi.SmsChannel) { | ||||
|   await ElMessageBox.confirm('确定要删除该短信渠道吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.signature]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteSmsChannel(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.signature])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteSmsChannel(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.signature])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除短信渠道 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该短信渠道吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该短信渠道吗?'); | ||||
|   await deleteSmsChannelList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemSmsTemplateApi } from '#/api/system/sms/template'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -63,23 +63,22 @@ function onSend(row: SystemSmsTemplateApi.SmsTemplate) { | |||
| 
 | ||||
| /** 删除短信模板 */ | ||||
| async function onDelete(row: SystemSmsTemplateApi.SmsTemplate) { | ||||
|   await ElMessageBox.confirm('确定要删除该短信模板吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteSmsTemplate(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteSmsTemplate(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除短信模板 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该短信模板吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该短信模板吗?'); | ||||
|   await deleteSmsTemplateList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemSocialClientApi } from '#/api/system/social/client'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -45,23 +45,22 @@ function onEdit(row: SystemSocialClientApi.SocialClient) { | |||
| 
 | ||||
| /** 删除社交客户端 */ | ||||
| async function onDelete(row: SystemSocialClientApi.SocialClient) { | ||||
|   await ElMessageBox.confirm('确定要删除该社交客户端吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteSocialClient(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteSocialClient(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除社交客户端 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该社交客户端吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该社交客户端吗?'); | ||||
|   await deleteSocialClientList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -8,10 +8,10 @@ import type { SystemTenantPackageApi } from '#/api/system/tenant-package'; | |||
| 
 | ||||
| import { onMounted, ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -64,23 +64,22 @@ function onEdit(row: SystemTenantApi.Tenant) { | |||
| 
 | ||||
| /** 删除租户 */ | ||||
| async function onDelete(row: SystemTenantApi.Tenant) { | ||||
|   await ElMessageBox.confirm('确定要删除该租户吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteTenant(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteTenant(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除租户 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该租户吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该租户吗?'); | ||||
|   await deleteTenantList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -7,10 +7,10 @@ import type { SystemTenantPackageApi } from '#/api/system/tenant-package'; | |||
| 
 | ||||
| import { ref } from 'vue'; | ||||
| 
 | ||||
| import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -45,23 +45,22 @@ function onEdit(row: SystemTenantPackageApi.TenantPackage) { | |||
| 
 | ||||
| /** 删除租户套餐 */ | ||||
| async function onDelete(row: SystemTenantPackageApi.TenantPackage) { | ||||
|   await ElMessageBox.confirm('确定要删除该租户套餐吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.name]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteTenantPackage(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteTenantPackage(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.name])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除租户套餐 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该租户套餐吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该租户套餐吗?'); | ||||
|   await deleteTenantPackageList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  |  | |||
|  | @ -336,7 +336,7 @@ export function useGridColumns<T = SystemUserApi.User>( | |||
|     }, | ||||
|     { | ||||
|       title: '操作', | ||||
|       width: 180, | ||||
|       width: 250, | ||||
|       fixed: 'right', | ||||
|       slots: { default: 'actions' }, | ||||
|     }, | ||||
|  |  | |||
|  | @ -8,7 +8,7 @@ import { ref } from 'vue'; | |||
| import { confirm, DocAlert, Page, useVbenModal } from '@vben/common-ui'; | ||||
| import { downloadFileFromBlobPart, isEmpty } from '@vben/utils'; | ||||
| 
 | ||||
| import { ElMessage, ElMessageBox } from 'element-plus'; | ||||
| import { ElLoading, ElMessage } from 'element-plus'; | ||||
| 
 | ||||
| import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; | ||||
| import { | ||||
|  | @ -83,23 +83,22 @@ function onEdit(row: SystemUserApi.User) { | |||
| 
 | ||||
| /** 删除用户 */ | ||||
| async function onDelete(row: SystemUserApi.User) { | ||||
|   await ElMessageBox.confirm('确定要删除该用户吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   const loadingInstance = ElLoading.service({ | ||||
|     text: $t('ui.actionMessage.deleting', [row.username]), | ||||
|     fullscreen: true, | ||||
|   }); | ||||
|   await deleteUser(row.id as number); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.username])); | ||||
|   onRefresh(); | ||||
|   try { | ||||
|     await deleteUser(row.id as number); | ||||
|     ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.username])); | ||||
|     onRefresh(); | ||||
|   } finally { | ||||
|     loadingInstance.close(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| /** 批量删除用户 */ | ||||
| async function onDeleteBatch() { | ||||
|   await ElMessageBox.confirm('确定要删除该用户吗?', { | ||||
|     confirmButtonText: '确定', | ||||
|     cancelButtonText: '取消', | ||||
|     type: 'warning', | ||||
|   }); | ||||
|   await confirm('确定要批量删除该用户吗?'); | ||||
|   await deleteUserList(checkedIds.value); | ||||
|   ElMessage.success($t('ui.actionMessage.deleteSuccess')); | ||||
|   onRefresh(); | ||||
|  | @ -261,7 +260,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ | |||
|                   icon: ACTION_ICON.DELETE, | ||||
|                   auth: ['system:user:delete'], | ||||
|                   popConfirm: { | ||||
|                     title: $t('ui.actionMessage.deleteConfirm', [row.name]), | ||||
|                     title: $t('ui.actionMessage.deleteConfirm', [row.username]), | ||||
|                     confirm: onDelete.bind(null, row), | ||||
|                   }, | ||||
|                 }, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 痴货
						痴货