|
|
|
@ -154,7 +154,7 @@ |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<!-- 确认删除对话框 --> |
|
|
|
<ConfirmDialog v-model="showDeleteDialog" message="删除该翻译记录!" @confirm="handleDeleteConfirm" |
|
|
|
<ConfirmDialog v-model="showDeleteDialog" :message="$t('common.deleteRecord')" @confirm="handleDeleteConfirm" |
|
|
|
@cancel="handleDeleteCancel" @close="handleDeleteClose" /> |
|
|
|
|
|
|
|
<!-- 编辑对话框 --> |
|
|
|
@ -215,7 +215,7 @@ |
|
|
|
<script setup> |
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'; |
|
|
|
import { onMounted, ref, computed } from 'vue' |
|
|
|
import API from "@/util/http.js" |
|
|
|
import request from "@/util/http.js" |
|
|
|
import moment from 'moment' |
|
|
|
import { UploadFilled } from '@element-plus/icons-vue' |
|
|
|
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue' |
|
|
|
@ -224,6 +224,9 @@ import { useAdminStore } from '@/store/index.js'; |
|
|
|
import { storeToRefs } from "pinia"; |
|
|
|
const adminStore = useAdminStore(); |
|
|
|
const { adminData } = storeToRefs(adminStore); |
|
|
|
// 国际化 |
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
// 响应式数据 |
|
|
|
const tableData = ref([]) |
|
|
|
@ -255,13 +258,7 @@ 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 truncateText = (text) => { |
|
|
|
@ -269,10 +266,7 @@ const truncateText = (text) => { |
|
|
|
return text.length > 20 ? text.substring(0, 20) + '...' : text |
|
|
|
} |
|
|
|
|
|
|
|
// 移除getStatusType方法,因为现在每个语言列单独判断状态 |
|
|
|
// const getStatusType = (status) => { |
|
|
|
// return status === 'translated' ? 'success' : 'info' |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// 搜索功能 |
|
|
|
const search = async () => { |
|
|
|
@ -297,8 +291,8 @@ const getTranslationList = async () => { |
|
|
|
...searchForm.value |
|
|
|
} |
|
|
|
|
|
|
|
// 这里调用实际的API接口 |
|
|
|
const res = await API({ |
|
|
|
// 这里调用实际的request接口 |
|
|
|
const res = await request({ |
|
|
|
url: '/language/getTranslation', |
|
|
|
data: params |
|
|
|
}) |
|
|
|
@ -358,6 +352,7 @@ const getMenuTree = async function () { |
|
|
|
ElMessage.error('网络异常') |
|
|
|
adminStore.clearState() |
|
|
|
} |
|
|
|
// console.log('1') |
|
|
|
} |
|
|
|
|
|
|
|
// 保存翻译 |
|
|
|
@ -379,7 +374,7 @@ const handleSave = async () => { |
|
|
|
|
|
|
|
try { |
|
|
|
const url = editForm.value.id ? '/language/updateTranslation' : '/language/addTranslation' |
|
|
|
const res = await API({ |
|
|
|
const res = await request({ |
|
|
|
url: url, |
|
|
|
data: editForm.value |
|
|
|
}) |
|
|
|
@ -412,7 +407,7 @@ const handleDelete = (row) => { |
|
|
|
// 确认删除 |
|
|
|
const handleDeleteConfirm = async () => { |
|
|
|
try { |
|
|
|
const res = await API({ |
|
|
|
const res = await request({ |
|
|
|
url: '/language/deleteTranslation', |
|
|
|
data: { id: currentDeleteRow.value.id } |
|
|
|
}) |
|
|
|
|