Browse Source

🐞 fix: 样式和request命名

huangqizheng/feature-20251213090502-现金退款多语言
zhangrenyuan 1 month ago
parent
commit
edf7a35830
  1. 8
      src/components/dialogs/LanguageSwitch.vue
  2. 3
      src/components/locales/lang/en.js
  3. 1
      src/components/locales/lang/zh-CN.js
  4. 29
      src/views/language/languageTranslate.vue

8
src/components/dialogs/LanguageSwitch.vue

@ -56,10 +56,10 @@ const tempLang = ref('')
//
const langOptions = [
{label: '中文(简体)', value: 'zh-CN'},
{label: '中文(繁體)', value: 'zh-TW'},
{label: '英语', value: 'en'},
{label: 'ภาษาไทย', value: 'th'},
{label: 'Tiếng Việt', value: 'vi'}
// {label: '()', value: 'zh-TW'},
{label: 'English', value: 'en'},
// {label: '', value: 'th'},
// {label: 'Tiếng Vit', value: 'vi'}
]
//

3
src/components/locales/lang/en.js

@ -73,7 +73,8 @@ export default {
goldBean: '',
// Dialog Titles
will: 'Action Notice',
will: 'Will ',
deleteRecord: 'Delete Record!',
},
// Message Group

1
src/components/locales/lang/zh-CN.js

@ -69,6 +69,7 @@ export default {
goldBean: '金豆',
// 对话框标题
will: '将要',
deleteRecord: '删除该翻译记录!',
},
// 提示信息组
elmessage: {

29
src/views/language/languageTranslate.vue

@ -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 }
})

Loading…
Cancel
Save