diff --git a/src/views/language/languageTranslate.vue b/src/views/language/languageTranslate.vue
index e8e17d3..7101170 100644
--- a/src/views/language/languageTranslate.vue
+++ b/src/views/language/languageTranslate.vue
@@ -6,28 +6,7 @@
搜索:
-
- 语言状态:
-
-
-
-
-
-
-
+
搜索
重置
@@ -50,7 +29,7 @@
-
+
@@ -60,83 +39,104 @@
-
+
-
- {{ truncateText(scope.row.english) }}
-
- {{ scope.row.english }}
+
+
+
+ {{ truncateText(scope.row.english) }}
+
+ {{ scope.row.english }}
+
+
+ {{ scope.row.english ? '已翻译' : '未翻译' }}
+
+
-
+
-
- {{ truncateText(scope.row.thai) }}
-
- {{ scope.row.thai }}
-
-
-
-
-
-
- {{ truncateText(scope.row.chineseTraditional) }}
-
- {{ scope.row.chineseTraditional }}
+
+
+
+ {{ truncateText(scope.row.thai) }}
+
+ {{ scope.row.thai }}
+
+
+ {{ scope.row.thai ? '已翻译' : '未翻译' }}
+
+
-
+
-
- {{ truncateText(scope.row.malay) }}
-
- {{ scope.row.malay }}
+
+
+
+ {{ truncateText(scope.row.chineseTraditional) }}
+
+ {{ scope.row.chineseTraditional }}
+
+
+ {{ scope.row.chineseTraditional ? '已翻译' : '未翻译' }}
+
+
-
+
-
- {{ truncateText(scope.row.vietnamese) }}
-
- {{ scope.row.vietnamese }}
+
+
+
+ {{ truncateText(scope.row.malay) }}
+
+ {{ scope.row.malay }}
+
+
+ {{ scope.row.malay ? '已翻译' : '未翻译' }}
+
+
-
-
-
+
-
- {{ scope.row.status === 'translated' ? '已翻译' : '未翻译' }}
-
+
+
+
+ {{ truncateText(scope.row.vietnamese) }}
+
+ {{ scope.row.vietnamese }}
+
+
+ {{ scope.row.vietnamese ? '已翻译' : '未翻译' }}
+
+
-
+
+
{{ moment(scope.row.configTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 编辑
- 删除
+
+ 编辑
+ 删除
+
@@ -187,14 +187,6 @@
-
@@ -235,15 +227,13 @@ import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue'
const tableData = ref([])
const pagination = ref({
pageNum: 1,
- pageSize: 10,
+ pageSize: 20,
total: 0
})
const searchForm = ref({
chineseSimplified: '',
- languageStatus: '',
- // module: [],
- // timeRange: []
+ // 移除languageStatus字段
})
const showEditDialog = ref(false)
@@ -263,13 +253,13 @@ const editForm = ref({
configTime: new Date()
})
-// 计算属性 - 判断翻译状态
-const translationStatus = computed(() => {
- return (row) => {
- const hasTranslation = row.english || row.thai || row.chineseTraditional || row.malay || row.vietnamese
- return hasTranslation ? 'translated' : 'untranslated'
- }
-})
+// 移除计算属性 - 不再需要统一的状态计算
+// const translationStatus = computed(() => {
+// return (row) => {
+// const hasTranslation = row.english || row.thai || row.chineseTraditional || row.malay || row.vietnamese
+// return hasTranslation ? 'translated' : 'untranslated'
+// }
+// })
// 方法定义
const truncateText = (text) => {
@@ -277,20 +267,11 @@ const truncateText = (text) => {
return text.length > 20 ? text.substring(0, 20) + '...' : text
}
-// const getModuleLabel = (module) => {
-// const moduleMap = {
-// 'dashboard': '工作台',
-// 'finance': '财务审核',
-// 'recharge': '充值管理',
-// 'consumption': '消耗管理',
-// }
-// return moduleMap[module] || module
+// 移除getStatusType方法,因为现在每个语言列单独判断状态
+// const getStatusType = (status) => {
+// return status === 'translated' ? 'success' : 'info'
// }
-const getStatusType = (status) => {
- return status === 'translated' ? 'success' : 'info'
-}
-
// 搜索功能
const search = async () => {
await getTranslationList()
@@ -300,9 +281,7 @@ const search = async () => {
const reset = () => {
searchForm.value = {
chineseSimplified: '',
- languageStatus: '',
- // module: [],
- // timeRange: []
+ // 移除languageStatus
}
getTranslationList()
}
@@ -323,10 +302,8 @@ const getTranslationList = async () => {
})
if (res.code === 200) {
- tableData.value = res.data.list.map(item => ({
- ...item,
- status: translationStatus.value(item)
- }))
+ // 不再需要设置统一的状态字段
+ tableData.value = res.data.list
pagination.value.total = res.data.total
}
} catch (error) {
@@ -375,6 +352,12 @@ const handleSave = async () => {
ElMessage.success(editForm.value.id ? '编辑成功' : '添加成功')
showEditDialog.value = false
getTranslationList()
+ } else if (res.code === 0) {
+ // 处理后端返回的错误信息
+ ElMessage.error(res.msg || '操作失败')
+ } else {
+ // 处理其他错误码
+ ElMessage.error(res.msg || '操作失败')
}
} catch (error) {
console.error('保存失败:', error)