优化前端双语配置
This commit is contained in:
@@ -186,6 +186,7 @@
|
||||
import api from '@/api/safeguard/server'
|
||||
import { onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { $t } from '@/locales'
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -219,16 +220,16 @@
|
||||
*/
|
||||
const handleClearCache = (tag: string): void => {
|
||||
if (!tag) {
|
||||
ElMessage.warning('请选择要清理的缓存')
|
||||
ElMessage.warning($t('uiMsg.clearCacheSelect'))
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(`确定要清理标签:【${tag}】的缓存吗?`, '清理选中缓存', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
ElMessageBox.confirm($t('uiMsg.clearCacheConfirmByTag', { tag }), $t('uiMsg.clearCacheTitle'), {
|
||||
confirmButtonText: $t('uiMsg.btnOk'),
|
||||
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||
type: 'error'
|
||||
}).then(() => {
|
||||
api.clear({ tag }).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||
updateCacheInfo()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -84,7 +84,8 @@
|
||||
<script setup lang="ts">
|
||||
import { useTable } from '@/hooks/core/useTable'
|
||||
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 TableSearch from './modules/table-search.vue'
|
||||
import TableDialog from './modules/table-dialog.vue'
|
||||
@@ -126,7 +127,12 @@
|
||||
columnsFactory: () => [
|
||||
{ type: 'selection' },
|
||||
{ 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: 'update_time', label: 'page.table.updateTime', width: 180, sortable: true },
|
||||
{ prop: 'rows', label: 'page.table.totalRows', width: 120 },
|
||||
@@ -134,7 +140,13 @@
|
||||
{ prop: 'data_length', label: 'page.table.dataSize', width: 120 },
|
||||
{ prop: 'collation', label: 'page.table.collation', width: 180 },
|
||||
{ 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 => {
|
||||
if (selectedRows.value.length === 0) {
|
||||
ElMessage.warning('请选择要优化的行')
|
||||
ElMessage.warning($t('page.ui.selectRowsToOptimize'))
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(
|
||||
`确定要优化选中的 ${selectedRows.value.length} 条数据吗?`,
|
||||
'优化选中数据',
|
||||
$t('page.ui.optimizeConfirm', { n: selectedRows.value.length }),
|
||||
$t('page.ui.optimizeTitle'),
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: $t('uiMsg.btnOk'),
|
||||
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||
type: 'error'
|
||||
}
|
||||
).then(() => {
|
||||
api.optimize({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||
refreshData()
|
||||
selectedRows.value = []
|
||||
})
|
||||
@@ -192,20 +204,20 @@
|
||||
*/
|
||||
const handleFragmentRows = (): void => {
|
||||
if (selectedRows.value.length === 0) {
|
||||
ElMessage.warning('请选择要清理碎片的行')
|
||||
ElMessage.warning($t('page.ui.selectRowsToFragment'))
|
||||
return
|
||||
}
|
||||
ElMessageBox.confirm(
|
||||
`确定要清理选中的 ${selectedRows.value.length} 条数据吗?`,
|
||||
'清理碎片操作',
|
||||
$t('page.ui.fragmentConfirm', { n: selectedRows.value.length }),
|
||||
$t('page.ui.fragmentTitle'),
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonText: $t('uiMsg.btnOk'),
|
||||
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||
type: 'error'
|
||||
}
|
||||
).then(() => {
|
||||
api.fragment({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||
refreshData()
|
||||
selectedRows.value = []
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user