优化前端双语配置
This commit is contained in:
@@ -84,7 +84,7 @@
|
|||||||
*/
|
*/
|
||||||
const clearCache = (): void => {
|
const clearCache = (): void => {
|
||||||
userStore.clearCache()
|
userStore.clearCache()
|
||||||
ElMessage.success('清理缓存成功')
|
ElMessage.success(t('uiMsg.clearCacheSuccess'))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
defineOptions({ name: 'SaExport' })
|
defineOptions({ name: 'SaExport' })
|
||||||
|
|
||||||
@@ -42,18 +43,18 @@
|
|||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
if (!props.url) {
|
if (!props.url) {
|
||||||
ElMessage.error('未配置导出接口')
|
ElMessage.error($t('uiMsg.exportNotConfigured'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalFileName = props.fileName
|
let finalFileName = props.fileName
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { value } = await ElMessageBox.prompt('请输入导出文件名称', '提示', {
|
const { value } = await ElMessageBox.prompt($t('uiMsg.exportPromptFileName'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
inputValue: props.fileName,
|
inputValue: props.fileName,
|
||||||
inputValidator: (val) => !!val.trim() || '文件名不能为空'
|
inputValidator: (val) => !!val.trim() || $t('uiMsg.exportFileNameRequired')
|
||||||
})
|
})
|
||||||
finalFileName = value
|
finalFileName = value
|
||||||
} catch {
|
} catch {
|
||||||
@@ -87,10 +88,10 @@
|
|||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
try {
|
try {
|
||||||
const result = JSON.parse(reader.result as string)
|
const result = JSON.parse(reader.result as string)
|
||||||
ElMessage.error(result.msg || '导出失败')
|
ElMessage.error(result.msg || $t('uiMsg.exportFail'))
|
||||||
emit('error', result)
|
emit('error', result)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ElMessage.error('导出失败')
|
ElMessage.error($t('uiMsg.exportFail'))
|
||||||
emit('error', e)
|
emit('error', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,11 +109,11 @@
|
|||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
URL.revokeObjectURL(url)
|
URL.revokeObjectURL(url)
|
||||||
|
|
||||||
ElMessage.success('导出成功')
|
ElMessage.success($t('uiMsg.exportSuccess'))
|
||||||
emit('success')
|
emit('success')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
ElMessage.error(error.message || '导出失败')
|
ElMessage.error(error.message || $t('uiMsg.exportFail'))
|
||||||
emit('error', error)
|
emit('error', error)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ref, nextTick } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SaiAdmin Composable
|
* SaiAdmin Composable
|
||||||
@@ -39,13 +40,13 @@ export function useSaiAdmin() {
|
|||||||
apiFn: (params: any) => Promise<any>,
|
apiFn: (params: any) => Promise<any>,
|
||||||
callback?: () => void
|
callback?: () => void
|
||||||
): void => {
|
): void => {
|
||||||
ElMessageBox.confirm(`确定要删除该数据吗?`, '删除数据', {
|
ElMessageBox.confirm($t('uiMsg.deleteConfirmSingle'), $t('uiMsg.titleDelete'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
apiFn({ ids: [row.id] }).then(() => {
|
apiFn({ ids: [row.id] }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success($t('uiMsg.deleteSuccess'))
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -57,20 +58,20 @@ export function useSaiAdmin() {
|
|||||||
callback?: () => void
|
callback?: () => void
|
||||||
): void => {
|
): void => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.warning('请选择要删除的行')
|
ElMessage.warning($t('uiMsg.selectRowsToDelete'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要删除选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('uiMsg.deleteConfirmSelected', { n: selectedRows.value.length }),
|
||||||
'删除选中数据',
|
$t('uiMsg.titleDeleteSelected'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
apiFn({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
apiFn({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success($t('uiMsg.deleteSuccess'))
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
selectedRows.value = []
|
selectedRows.value = []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ const i18n: I18n = createI18n(i18nOptions)
|
|||||||
* 翻译函数类型
|
* 翻译函数类型
|
||||||
*/
|
*/
|
||||||
interface Translation {
|
interface Translation {
|
||||||
(key: string): string
|
(key: string, named?: Record<string, unknown>): string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -39,6 +39,46 @@
|
|||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"logOutTips": "Do you want to log out?"
|
"logOutTips": "Do you want to log out?"
|
||||||
},
|
},
|
||||||
|
"uiMsg": {
|
||||||
|
"titlePrompt": "Prompt",
|
||||||
|
"titleDelete": "Delete",
|
||||||
|
"titleDeleteSelected": "Delete selected",
|
||||||
|
"btnOk": "Confirm",
|
||||||
|
"btnCancel": "Cancel",
|
||||||
|
"deleteConfirmSingle": "Are you sure you want to delete this item?",
|
||||||
|
"deleteConfirmSelected": "Are you sure you want to delete the selected {n} items?",
|
||||||
|
"deleteSuccess": "Deleted",
|
||||||
|
"operationSuccess": "Success",
|
||||||
|
"selectRowsToDelete": "Please select rows to delete",
|
||||||
|
"selectAtLeastOne": "Please select at least one item",
|
||||||
|
"clearCacheSuccess": "Cache cleared",
|
||||||
|
"copySuccess": "Copied",
|
||||||
|
"copyFail": "Copy failed, please copy manually",
|
||||||
|
"uploadSuccess": "Uploaded",
|
||||||
|
"uploadFail": "Upload failed",
|
||||||
|
"downloadTemplateFail": "Failed to download template",
|
||||||
|
"importSuccess": "Imported",
|
||||||
|
"importFail": "Import failed",
|
||||||
|
"exportFail": "Export failed",
|
||||||
|
"exportSuccess": "Exported"
|
||||||
|
,
|
||||||
|
"exportNotConfigured": "Export API is not configured",
|
||||||
|
"exportPromptFileName": "Please enter export file name",
|
||||||
|
"exportFileNameRequired": "File name is required",
|
||||||
|
"clearCacheSelect": "Please select a cache to clear",
|
||||||
|
"clearCacheTitle": "Clear selected cache",
|
||||||
|
"clearCacheConfirmByTag": "Are you sure you want to clear cache for tag: {tag}?"
|
||||||
|
,
|
||||||
|
"saipackageWebBuildTitle": "Frontend build & publish",
|
||||||
|
"saipackageWebBuildConfirm": "Rebuild frontend and publish the project?",
|
||||||
|
"saipackageWebBuildSuccess": "Frontend built and published",
|
||||||
|
"saipackageFrontendDepsTitle": "Frontend dependencies",
|
||||||
|
"saipackageFrontendDepsConfirm": "Update frontend Node dependencies?",
|
||||||
|
"saipackageFrontendDepsSuccess": "Frontend dependencies updated",
|
||||||
|
"saipackageComposerTitle": "Composer dependencies",
|
||||||
|
"saipackageComposerConfirm": "Update backend Composer packages?",
|
||||||
|
"saipackageComposerSuccess": "Composer packages updated"
|
||||||
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"placeholderInput": "Please enter",
|
"placeholderInput": "Please enter",
|
||||||
"placeholderSelect": "Please select",
|
"placeholderSelect": "Please select",
|
||||||
|
|||||||
@@ -67,5 +67,10 @@
|
|||||||
"ruleStatusRequired": "Status is required",
|
"ruleStatusRequired": "Status is required",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully"
|
"editSuccess": "Updated successfully"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"clearAllConfirm": "Are you sure you want to clear all player draw test data?",
|
||||||
|
"clearAllSuccess": "All test data cleared",
|
||||||
|
"clearAllFail": "Clear failed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,5 +47,11 @@
|
|||||||
"ruleRoleRequired": "Please select role",
|
"ruleRoleRequired": "Please select role",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully"
|
"editSuccess": "Updated successfully"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"promptNewPassword": "Please enter a new password",
|
||||||
|
"passwordLengthError": "Password length must be between 6 and 16",
|
||||||
|
"passwordChanged": "Password updated",
|
||||||
|
"clearCacheConfirm": "Are you sure you want to clear cache?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,16 @@
|
|||||||
"tplCategory": "Gen Type",
|
"tplCategory": "Gen Type",
|
||||||
"updateTime": "Update Time",
|
"updateTime": "Update Time",
|
||||||
"createTime": "Create Time"
|
"createTime": "Create Time"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"generating": "Generating code package, please wait...",
|
||||||
|
"generateSuccess": "Code generated, downloading...",
|
||||||
|
"downloadFail": "Download failed",
|
||||||
|
"syncConfirm": "Sync will overwrite the configured table structure. Continue?",
|
||||||
|
"syncSuccess": "Synced",
|
||||||
|
"generateToProjectConfirm": "Generate-to-project will overwrite existing files. Continue?",
|
||||||
|
"generateToProjectSuccess": "Generated to project",
|
||||||
|
"loadSuccess": "Loaded",
|
||||||
|
"copyToClipboard": "Code copied to clipboard"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,5 +58,11 @@
|
|||||||
"ruleTargetRequired": "Target is required",
|
"ruleTargetRequired": "Target is required",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully"
|
"editSuccess": "Updated successfully"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"runTitle": "Run Task",
|
||||||
|
"runConfirm": "Are you sure you want to run task [{name}]?",
|
||||||
|
"runSuccess": "Task started",
|
||||||
|
"selectTaskFirst": "Please select a task first"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,46 @@
|
|||||||
"confirm": "确定",
|
"confirm": "确定",
|
||||||
"logOutTips": "您是否要退出登录?"
|
"logOutTips": "您是否要退出登录?"
|
||||||
},
|
},
|
||||||
|
"uiMsg": {
|
||||||
|
"titlePrompt": "提示",
|
||||||
|
"titleDelete": "删除数据",
|
||||||
|
"titleDeleteSelected": "删除选中数据",
|
||||||
|
"btnOk": "确定",
|
||||||
|
"btnCancel": "取消",
|
||||||
|
"deleteConfirmSingle": "确定要删除该数据吗?",
|
||||||
|
"deleteConfirmSelected": "确定要删除选中的 {n} 条数据吗?",
|
||||||
|
"deleteSuccess": "删除成功",
|
||||||
|
"operationSuccess": "操作成功",
|
||||||
|
"selectRowsToDelete": "请选择要删除的行",
|
||||||
|
"selectAtLeastOne": "至少要选择一条数据",
|
||||||
|
"clearCacheSuccess": "清理缓存成功",
|
||||||
|
"copySuccess": "复制成功",
|
||||||
|
"copyFail": "复制失败,请手动复制",
|
||||||
|
"uploadSuccess": "上传成功",
|
||||||
|
"uploadFail": "上传失败",
|
||||||
|
"downloadTemplateFail": "下载模板失败",
|
||||||
|
"importSuccess": "导入成功",
|
||||||
|
"importFail": "导入失败",
|
||||||
|
"exportFail": "导出失败",
|
||||||
|
"exportSuccess": "导出成功"
|
||||||
|
,
|
||||||
|
"exportNotConfigured": "未配置导出接口",
|
||||||
|
"exportPromptFileName": "请输入导出文件名称",
|
||||||
|
"exportFileNameRequired": "文件名不能为空",
|
||||||
|
"clearCacheSelect": "请选择要清理的缓存",
|
||||||
|
"clearCacheTitle": "清理选中缓存",
|
||||||
|
"clearCacheConfirmByTag": "确定要清理标签:【{tag}】的缓存吗?"
|
||||||
|
,
|
||||||
|
"saipackageWebBuildTitle": "前端打包发布",
|
||||||
|
"saipackageWebBuildConfirm": "确认重新打包前端并发布项目吗?",
|
||||||
|
"saipackageWebBuildSuccess": "前端打包发布成功",
|
||||||
|
"saipackageFrontendDepsTitle": "前端依赖更新",
|
||||||
|
"saipackageFrontendDepsConfirm": "确认更新前端Node依赖吗?",
|
||||||
|
"saipackageFrontendDepsSuccess": "前端依赖更新成功",
|
||||||
|
"saipackageComposerTitle": "composer包更新",
|
||||||
|
"saipackageComposerConfirm": "确认更新后端composer包吗?",
|
||||||
|
"saipackageComposerSuccess": "composer包更新成功"
|
||||||
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"placeholderInput": "请输入",
|
"placeholderInput": "请输入",
|
||||||
"placeholderSelect": "请选择",
|
"placeholderSelect": "请选择",
|
||||||
|
|||||||
@@ -67,5 +67,10 @@
|
|||||||
"ruleStatusRequired": "状态必需填写",
|
"ruleStatusRequired": "状态必需填写",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功"
|
"editSuccess": "修改成功"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"clearAllConfirm": "确定清空所有玩家抽奖测试数据?",
|
||||||
|
"clearAllSuccess": "已清空所有测试数据",
|
||||||
|
"clearAllFail": "清空失败"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,5 +47,11 @@
|
|||||||
"ruleRoleRequired": "请选择角色",
|
"ruleRoleRequired": "请选择角色",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功"
|
"editSuccess": "修改成功"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"promptNewPassword": "请输入新密码",
|
||||||
|
"passwordLengthError": "密码长度在6到16之间",
|
||||||
|
"passwordChanged": "修改密码成功",
|
||||||
|
"clearCacheConfirm": "确定要清理缓存吗?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,16 @@
|
|||||||
"tplCategory": "生成类型",
|
"tplCategory": "生成类型",
|
||||||
"updateTime": "更新时间",
|
"updateTime": "更新时间",
|
||||||
"createTime": "创建时间"
|
"createTime": "创建时间"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"generating": "代码生成下载中,请稍后",
|
||||||
|
"generateSuccess": "代码生成成功,开始下载",
|
||||||
|
"downloadFail": "文件下载失败",
|
||||||
|
"syncConfirm": "执行同步操作将会覆盖已经设置的表结构,确定要同步吗?",
|
||||||
|
"syncSuccess": "同步成功",
|
||||||
|
"generateToProjectConfirm": "生成到项目将会覆盖原有文件,确定要生成吗?",
|
||||||
|
"generateToProjectSuccess": "生成到项目成功",
|
||||||
|
"loadSuccess": "装载成功",
|
||||||
|
"copyToClipboard": "代码已复制到剪贴板"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,5 +58,11 @@
|
|||||||
"ruleTargetRequired": "调用目标不能为空",
|
"ruleTargetRequired": "调用目标不能为空",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功"
|
"editSuccess": "修改成功"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"runTitle": "运行任务",
|
||||||
|
"runConfirm": "确定要运行任务【{name}】吗?",
|
||||||
|
"runSuccess": "任务运行成功",
|
||||||
|
"selectTaskFirst": "请先选择一个任务"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,15 +208,15 @@
|
|||||||
|
|
||||||
const handleClearAll = async () => {
|
const handleClearAll = async () => {
|
||||||
try {
|
try {
|
||||||
await ElMessageBox.confirm('确定清空所有玩家抽奖测试数据?', '提示', {
|
await ElMessageBox.confirm(t('page.ui.clearAllConfirm'), t('uiMsg.titlePrompt'), {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
await api.clearAll()
|
await api.clearAll()
|
||||||
ElMessage.success('已清空所有测试数据')
|
ElMessage.success(t('page.ui.clearAllSuccess'))
|
||||||
getData()
|
getData()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if (e !== 'cancel') {
|
if (e !== 'cancel') {
|
||||||
ElMessage.error(e?.message || '清空失败')
|
ElMessage.error(e?.message || t('page.ui.clearAllFail'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { useTerminalStore, TaskStatus } from '../store/terminal'
|
import { useTerminalStore, TaskStatus } from '../store/terminal'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'success'): void
|
(e: 'success'): void
|
||||||
@@ -157,51 +158,51 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const webBuild = () => {
|
const webBuild = () => {
|
||||||
ElMessageBox.confirm('确认重新打包前端并发布项目吗?', '前端打包发布', {
|
ElMessageBox.confirm($t('uiMsg.saipackageWebBuildConfirm'), $t('uiMsg.saipackageWebBuildTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
terminal.addNodeTask('web-build', '', () => {
|
terminal.addNodeTask('web-build', '', () => {
|
||||||
ElMessage.success('前端打包发布成功')
|
ElMessage.success($t('uiMsg.saipackageWebBuildSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFronted = () => {
|
const handleFronted = () => {
|
||||||
ElMessageBox.confirm('确认更新前端Node依赖吗?', '前端依赖更新', {
|
ElMessageBox.confirm($t('uiMsg.saipackageFrontendDepsConfirm'), $t('uiMsg.saipackageFrontendDepsTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
terminal.addNodeTask('web-install', '', () => {
|
terminal.addNodeTask('web-install', '', () => {
|
||||||
ElMessage.success('前端依赖更新成功')
|
ElMessage.success($t('uiMsg.saipackageFrontendDepsSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBackend = () => {
|
const handleBackend = () => {
|
||||||
ElMessageBox.confirm('确认更新后端composer包吗?', 'composer包更新', {
|
ElMessageBox.confirm($t('uiMsg.saipackageComposerConfirm'), $t('uiMsg.saipackageComposerTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
terminal.addTask('composer.update', '', () => {
|
terminal.addTask('composer.update', '', () => {
|
||||||
ElMessage.success('composer包更新成功')
|
ElMessage.success($t('uiMsg.saipackageComposerSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const frontInstall = (extend = '') => {
|
const frontInstall = (extend = '') => {
|
||||||
terminal.addNodeTask('web-install', extend, () => {
|
terminal.addNodeTask('web-install', extend, () => {
|
||||||
ElMessage.success('前端依赖更新成功')
|
ElMessage.success($t('uiMsg.saipackageFrontendDepsSuccess'))
|
||||||
emit('success')
|
emit('success')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const backendInstall = (extend = '') => {
|
const backendInstall = (extend = '') => {
|
||||||
terminal.addTask('composer.update', extend, () => {
|
terminal.addTask('composer.update', extend, () => {
|
||||||
ElMessage.success('composer包更新成功')
|
ElMessage.success($t('uiMsg.saipackageComposerSuccess'))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
emit('success')
|
emit('success')
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@@ -186,6 +186,7 @@
|
|||||||
import api from '@/api/safeguard/server'
|
import api from '@/api/safeguard/server'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
@@ -219,16 +220,16 @@
|
|||||||
*/
|
*/
|
||||||
const handleClearCache = (tag: string): void => {
|
const handleClearCache = (tag: string): void => {
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
ElMessage.warning('请选择要清理的缓存')
|
ElMessage.warning($t('uiMsg.clearCacheSelect'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(`确定要清理标签:【${tag}】的缓存吗?`, '清理选中缓存', {
|
ElMessageBox.confirm($t('uiMsg.clearCacheConfirmByTag', { tag }), $t('uiMsg.clearCacheTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.clear({ tag }).then(() => {
|
api.clear({ tag }).then(() => {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||||
updateCacheInfo()
|
updateCacheInfo()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -84,7 +84,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/safeguard/database'
|
import api from '@/api/safeguard/database'
|
||||||
import TableSearch from './modules/table-search.vue'
|
import TableSearch from './modules/table-search.vue'
|
||||||
import TableDialog from './modules/table-dialog.vue'
|
import TableDialog from './modules/table-dialog.vue'
|
||||||
@@ -126,7 +127,12 @@
|
|||||||
columnsFactory: () => [
|
columnsFactory: () => [
|
||||||
{ type: 'selection' },
|
{ type: 'selection' },
|
||||||
{ prop: 'name', label: 'page.table.tableName', minWidth: 200 },
|
{ prop: 'name', label: 'page.table.tableName', minWidth: 200 },
|
||||||
{ prop: 'comment', label: 'page.table.tableComment', minWidth: 150, showOverflowTooltip: true },
|
{
|
||||||
|
prop: 'comment',
|
||||||
|
label: 'page.table.tableComment',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowTooltip: true
|
||||||
|
},
|
||||||
{ prop: 'engine', label: 'page.table.tableEngine', width: 120 },
|
{ prop: 'engine', label: 'page.table.tableEngine', width: 120 },
|
||||||
{ prop: 'update_time', label: 'page.table.updateTime', width: 180, sortable: true },
|
{ prop: 'update_time', label: 'page.table.updateTime', width: 180, sortable: true },
|
||||||
{ prop: 'rows', label: 'page.table.totalRows', width: 120 },
|
{ prop: 'rows', label: 'page.table.totalRows', width: 120 },
|
||||||
@@ -134,7 +140,13 @@
|
|||||||
{ prop: 'data_length', label: 'page.table.dataSize', width: 120 },
|
{ prop: 'data_length', label: 'page.table.dataSize', width: 120 },
|
||||||
{ prop: 'collation', label: 'page.table.collation', width: 180 },
|
{ prop: 'collation', label: 'page.table.collation', width: 180 },
|
||||||
{ prop: 'create_time', label: 'page.table.createTime', width: 180, sortable: true },
|
{ prop: 'create_time', label: 'page.table.createTime', width: 180, sortable: true },
|
||||||
{ prop: 'operation', label: 'table.actions.operation', width: 100, fixed: 'right', useSlot: true }
|
{
|
||||||
|
prop: 'operation',
|
||||||
|
label: 'table.actions.operation',
|
||||||
|
width: 100,
|
||||||
|
fixed: 'right',
|
||||||
|
useSlot: true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -167,20 +179,20 @@
|
|||||||
*/
|
*/
|
||||||
const handleOptimizeRows = (): void => {
|
const handleOptimizeRows = (): void => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.warning('请选择要优化的行')
|
ElMessage.warning($t('page.ui.selectRowsToOptimize'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要优化选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('page.ui.optimizeConfirm', { n: selectedRows.value.length }),
|
||||||
'优化选中数据',
|
$t('page.ui.optimizeTitle'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
api.optimize({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
api.optimize({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
selectedRows.value = []
|
selectedRows.value = []
|
||||||
})
|
})
|
||||||
@@ -192,20 +204,20 @@
|
|||||||
*/
|
*/
|
||||||
const handleFragmentRows = (): void => {
|
const handleFragmentRows = (): void => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.warning('请选择要清理碎片的行')
|
ElMessage.warning($t('page.ui.selectRowsToFragment'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要清理选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('page.ui.fragmentConfirm', { n: selectedRows.value.length }),
|
||||||
'清理碎片操作',
|
$t('page.ui.fragmentTitle'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
api.fragment({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
api.fragment({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
selectedRows.value = []
|
selectedRows.value = []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -129,7 +129,8 @@
|
|||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import TableSearch from './modules/table-search.vue'
|
import TableSearch from './modules/table-search.vue'
|
||||||
import EditDialog from './modules/edit-dialog.vue'
|
import EditDialog from './modules/edit-dialog.vue'
|
||||||
import WorkDialog from './modules/work-dialog.vue'
|
import WorkDialog from './modules/work-dialog.vue'
|
||||||
@@ -252,15 +253,15 @@
|
|||||||
* @param row
|
* @param row
|
||||||
*/
|
*/
|
||||||
const handlePassword = (row: any) => {
|
const handlePassword = (row: any) => {
|
||||||
ElMessageBox.prompt('请输入新密码', '提示', {
|
ElMessageBox.prompt($t('page.ui.promptNewPassword'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
inputPattern: /^.{6,16}$/,
|
inputPattern: /^.{6,16}$/,
|
||||||
inputErrorMessage: '密码长度在6到16之间',
|
inputErrorMessage: $t('page.ui.passwordLengthError'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
api.changePassword({ id: row.id, password: value }).then(() => {
|
api.changePassword({ id: row.id, password: value }).then(() => {
|
||||||
ElMessage.success('修改密码成功')
|
ElMessage.success($t('page.ui.passwordChanged'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -270,13 +271,13 @@
|
|||||||
* @param row
|
* @param row
|
||||||
*/
|
*/
|
||||||
const handleCache = (row: any) => {
|
const handleCache = (row: any) => {
|
||||||
ElMessageBox.confirm('确定要清理缓存吗?', '提示', {
|
ElMessageBox.confirm($t('page.ui.clearCacheConfirm'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.clearCache({ id: row.id }).then(() => {
|
api.clearCache({ id: row.id }).then(() => {
|
||||||
ElMessage.success('清理缓存成功')
|
ElMessage.success($t('uiMsg.clearCacheSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/safeguard/database'
|
import api from '@/api/safeguard/database'
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import generate from '@/api/tool/generate'
|
import generate from '@/api/tool/generate'
|
||||||
@@ -172,7 +173,7 @@
|
|||||||
// 确认选择装载数据表
|
// 确认选择装载数据表
|
||||||
const handleLoadTable = async () => {
|
const handleLoadTable = async () => {
|
||||||
if (selectedRows.value.length < 1) {
|
if (selectedRows.value.length < 1) {
|
||||||
ElMessage.info('至少要选择一条数据')
|
ElMessage.info($t('uiMsg.selectAtLeastOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const names = selectedRows.value.map((item) => ({
|
const names = selectedRows.value.map((item) => ({
|
||||||
@@ -185,7 +186,7 @@
|
|||||||
source: searchForm.value.source,
|
source: searchForm.value.source,
|
||||||
names
|
names
|
||||||
})
|
})
|
||||||
ElMessage.success('装载成功')
|
ElMessage.success($t('page.ui.loadSuccess'))
|
||||||
emit('success')
|
emit('success')
|
||||||
handleClose()
|
handleClose()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useClipboard } from '@vueuse/core'
|
import { useClipboard } from '@vueuse/core'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import generate from '@/api/tool/generate'
|
import generate from '@/api/tool/generate'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -94,9 +95,9 @@
|
|||||||
const handleCopy = async (code: string) => {
|
const handleCopy = async (code: string) => {
|
||||||
try {
|
try {
|
||||||
await copy(code)
|
await copy(code)
|
||||||
ElMessage.success('代码已复制到剪贴板')
|
ElMessage.success($t('page.ui.copyToClipboard'))
|
||||||
} catch {
|
} catch {
|
||||||
ElMessage.error('复制失败,请手动复制')
|
ElMessage.error($t('uiMsg.copyFail'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -133,6 +133,7 @@
|
|||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/tool/generate'
|
import api from '@/api/tool/generate'
|
||||||
import { downloadFile } from '@/utils/tool'
|
import { downloadFile } from '@/utils/tool'
|
||||||
|
|
||||||
@@ -211,15 +212,15 @@
|
|||||||
* 生成代码下载
|
* 生成代码下载
|
||||||
*/
|
*/
|
||||||
const generateCode = async (ids: number | string) => {
|
const generateCode = async (ids: number | string) => {
|
||||||
ElMessage.info('代码生成下载中,请稍后')
|
ElMessage.info($t('page.ui.generating'))
|
||||||
const response = await api.generateCode({
|
const response = await api.generateCode({
|
||||||
ids: ids.toString().split(',')
|
ids: ids.toString().split(',')
|
||||||
})
|
})
|
||||||
if (response) {
|
if (response) {
|
||||||
downloadFile(response, 'code.zip')
|
downloadFile(response, 'code.zip')
|
||||||
ElMessage.success('代码生成成功,开始下载')
|
ElMessage.success($t('page.ui.generateSuccess'))
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('文件下载失败')
|
ElMessage.error($t('page.ui.downloadFail'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,13 +228,13 @@
|
|||||||
* 同步表结构
|
* 同步表结构
|
||||||
*/
|
*/
|
||||||
const syncTable = async (id: number) => {
|
const syncTable = async (id: number) => {
|
||||||
ElMessageBox.confirm('执行同步操作将会覆盖已经设置的表结构,确定要同步吗?', '提示', {
|
ElMessageBox.confirm($t('page.ui.syncConfirm'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.async({ id }).then(() => {
|
api.async({ id }).then(() => {
|
||||||
ElMessage.success('同步成功')
|
ElMessage.success($t('page.ui.syncSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -242,13 +243,13 @@
|
|||||||
* 生成到项目
|
* 生成到项目
|
||||||
*/
|
*/
|
||||||
const generateFile = async (id: number) => {
|
const generateFile = async (id: number) => {
|
||||||
ElMessageBox.confirm('生成到项目将会覆盖原有文件,确定要生成吗?', '提示', {
|
ElMessageBox.confirm($t('page.ui.generateToProjectConfirm'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.generateFile({ id }).then(() => {
|
api.generateFile({ id }).then(() => {
|
||||||
ElMessage.success('生成到项目成功')
|
ElMessage.success($t('page.ui.generateToProjectSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -258,7 +259,7 @@
|
|||||||
*/
|
*/
|
||||||
const batchGenerate = () => {
|
const batchGenerate = () => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.error('至少要选择一条数据')
|
ElMessage.error($t('uiMsg.selectAtLeastOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
generateCode(selectedRows.value.map((item: any) => item.id).join(','))
|
generateCode(selectedRows.value.map((item: any) => item.id).join(','))
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/tool/crontab'
|
import api from '@/api/tool/crontab'
|
||||||
import TableSearch from './modules/table-search.vue'
|
import TableSearch from './modules/table-search.vue'
|
||||||
import EditDialog from './modules/edit-dialog.vue'
|
import EditDialog from './modules/edit-dialog.vue'
|
||||||
@@ -146,13 +147,13 @@
|
|||||||
|
|
||||||
// 运行任务
|
// 运行任务
|
||||||
const handleRun = (row: any) => {
|
const handleRun = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定要运行任务【${row.name}】吗?`, '运行任务', {
|
ElMessageBox.confirm($t('page.ui.runConfirm', { name: row.name }), $t('page.ui.runTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.run({ id: row.id }).then(() => {
|
api.run({ id: row.id }).then(() => {
|
||||||
ElMessage.success('任务运行成功')
|
ElMessage.success($t('page.ui.runSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/tool/crontab'
|
import api from '@/api/tool/crontab'
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
*/
|
*/
|
||||||
const initPage = async () => {
|
const initPage = async () => {
|
||||||
if (!props.data?.id) {
|
if (!props.data?.id) {
|
||||||
ElMessage.error('请先选择一个任务')
|
ElMessage.error($t('page.ui.selectTaskFirst'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
searchForm.value.crontab_id = props.data.id
|
searchForm.value.crontab_id = props.data.id
|
||||||
@@ -166,20 +167,20 @@
|
|||||||
// 确认选择装载数据表
|
// 确认选择装载数据表
|
||||||
const handleLoadTable = async () => {
|
const handleLoadTable = async () => {
|
||||||
if (selectedRows.value.length < 1) {
|
if (selectedRows.value.length < 1) {
|
||||||
ElMessage.info('至少要选择一条数据')
|
ElMessage.info($t('uiMsg.selectAtLeastOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要删除选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('uiMsg.deleteConfirmSelected', { n: selectedRows.value.length }),
|
||||||
'删除选中数据',
|
$t('uiMsg.titleDeleteSelected'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
api.deleteCrontabLog({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
api.deleteCrontabLog({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success($t('uiMsg.deleteSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user