-
姓名:
+
{{ t('common_add_user.name') }}:
{{ user.name }}
-
当前付费金豆:
+
{{ t('common_add_user.permanentBean') }}:
{{ Number(user.permanentBean) }}
@@ -246,17 +250,17 @@ const throttledHandleConsumeFormt = _.throttle(handleConsumeForm, 5000, {
-
精网号:
+
{{ t('common_add_user.jwcode') }}:
{{ user.jwcode }}
-
当前免费金豆:
+
{{ t('common_add_user.freeBean') }}:
{{ user.freeBean }}
-
所属门店:
+
{{ t('common_add_user.store') }}:
{{ user.market }}
-
消耗金豆总数:
+
{{ t('common_add_user.consumeTotalBean') }}:
{{ user.consumeSum }}
{{ 0 }}
@@ -285,13 +289,13 @@ const throttledHandleConsumeFormt = _.throttle(handleConsumeForm, 5000, {
.right {
flex: 1;
display: flex;
- float: left;
+ // float: left;
.customer-info {
- width: 35vw;
+ min-width: 35vw;
height: 28vh;
margin-top: 5vh;
- display: flex;
+ // display: flex;
justify-content: center;
}
}
diff --git a/src/views/consume/bean/articleVideo.vue b/src/views/consume/bean/articleVideo.vue
index a52c598..d9c7c1d 100644
--- a/src/views/consume/bean/articleVideo.vue
+++ b/src/views/consume/bean/articleVideo.vue
@@ -9,6 +9,10 @@ import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
const adminStore = useAdminStore();
const { flag } = storeToRefs(adminStore);
+// 国际化
+import { useI18n } from 'vue-i18n';
+const { t } = useI18n();
+
// 监听全局flag状态变化
watch(flag, (newFlag, oldFlag) => {
// 当flag状态改变时,重新发送请求
@@ -55,9 +59,9 @@ const channels = ref([])
// 抽离类型选项到响应式数组
const consumeTypes = ref([
- { label: '打赏', value: 9 },
- { label: '打赏', value: 10 },
- { label: '付费购买', value: 11 },
+ { label: t('consume.consumeTypes.9'), value: 9 },
+ { label: t('consume.consumeTypes.10'), value: 10 },
+ { label: t('consume.consumeTypes.11'), value: 11 },
])
// 处理 payMode 选择变化
@@ -110,7 +114,7 @@ const getDept = async function () {
console.log('请求地区列表失败', error)
ElMessage({
type: 'error',
- message: '获取地区列表失败,请稍后重试'
+ message: t('elmessage.getRegionListFailed')
})
}
}
@@ -257,14 +261,14 @@ const search = function () {
if (beanConsumeArticle.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(beanConsumeArticle.value.jwcode)) {
- ElMessage.error('请检查精网号格式')
+ ElMessage.error(t('elmessage.checkJwcodeFormat'))
return
}
}
if (beanConsumeArticle.value.articleId) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(beanConsumeArticle.value.articleId)) {
- ElMessage.error('请检查文章ID格式')
+ ElMessage.error(t('elmessage.checkArticleIdFormat'))
return
}
}
@@ -401,9 +405,16 @@ const exportExcel = async function () {
},
}
- const res = await API({ url: '/export/exportArticle', data: params })
- if (res.code === 200) {
- ElMessage.success('导出成功')
+ try {
+ const res = await API({url: '/export/exportArticle', data: params});
+ if (res.code === 200) {
+ ElMessage.success(t('elmessage.exportSuccess'));
+ } else {
+ ElMessage.error(res.message || t('elmessage.exportFailed'));
+ }
+ } catch (error) {
+ console.error('导出请求出错:', error);
+ ElMessage.error(t('elmessage.exportFailed'));
}
}
const exportListVisible = ref(false)
@@ -429,11 +440,11 @@ const getExportList = async () => {
});
exportList.value = filteredData
} else {
- ElMessage.error(result.msg || '获取导出列表失败')
+ ElMessage.error(result.msg || t('elmessage.getExportListError'))
}
} catch (error) {
console.error('获取导出列表出错:', error)
- ElMessage.error('获取导出列表失败,请稍后重试')
+ ElMessage.error(t('elmessage.getExportListError'))
} finally {
exportListLoading.value = false
}
@@ -446,7 +457,7 @@ const downloadExportFile = (item) => {
link.download = item.fileName
link.click()
} else {
- ElMessage.warning('文件还在导出中,请稍后再试')
+ ElMessage.warning(t('elmessage.exportingInProgress'))
}
}
//根据状态返回对应的标签类型
@@ -468,15 +479,15 @@ const getTagType = (state) => {
const getTagText = (state) => {
switch (state) {
case 0:
- return '待执行';
+ return t('elmessage.pendingExecution');
case 1:
- return '执行中';
+ return t('elmessage.executing');
case 2:
- return '执行完成';
+ return t('elmessage.executed');
case 3:
- return '执行出错';
+ return t('elmessage.errorExecution');
default:
- return '未知状态';
+ return t('elmessage.unknownStatus');
}
}
@@ -486,27 +497,27 @@ const getTagText = (state) => {
- 精网号:
-
+ {{ t('common.jwcode') }}:
+
- 地区:
-
+ {{ t('common.market') }}:
+
- 类型:
- {{ t('common.type') }}:
+
-
-
-
+
+
+
- 文章/视频ID:
-
+ {{ t('common.articleVideoID') }}:
+
@@ -515,9 +526,9 @@ const getTagText = (state) => {
-
付费时间:
-
{{ t('common.payTime') }}:
+
今
@@ -526,35 +537,35 @@ const getTagText = (state) => {
- 作者:
-
+ {{ t('common.author') }}:
+
- 文章/视频标题:
-
+ {{ t('common.articleVideoTitle') }}:
+
- 查询
- 导出Excel
- 查看导出列表
- 重置
+ {{ t('common.search') }}
+ {{ t('common.exportExcel') }}
+ {{ t('common.viewExportList') }}
+ {{ t('common.reset') }}
- 金豆总数:{{ format3(Math.abs(permanentBean + freeBean)) }}
- 付费金豆数:{{ format3(Math.abs(permanentBean)) }}
- 免费金豆数:{{ format3(Math.abs(freeBean)) }}
+ {{ t('common.totalGoldBean') }}{{ format3(Math.abs(permanentBean + freeBean)) }}
+ {{ t('common.payGoldBean') }}{{ format3(Math.abs(permanentBean)) }}
+ {{ t('common.freeGoldBean') }}{{ format3(Math.abs(freeBean)) }}
-
-
+
{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
@@ -562,26 +573,26 @@ const getTagText = (state) => {
-
+
-
-
-
+
+
+
{{
Array.isArray(consumeTypes)
- ? consumeTypes.find(item => item.value === Number(scope.row.type))?.label || '未知类型'
- : '未知类型'
+ ? consumeTypes.find(item => item.value === Number(scope.row.type))?.label || t('common_list.unknownType')
+ : t('common_list.unknownType')
}}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{{ formatTime(scope.row.consumeTime) }}
@@ -598,33 +609,33 @@ const getTagText = (state) => {
-
+
-
-
+
+
{{ getTagText(scope.row.state) }}
-
+
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 下载
+ {{ t('common_export.download') }}
@@ -693,11 +704,11 @@ const getTagText = (state) => {
padding: 0 0.5vw;
.text {
- width: 5vw;
+ width: 5.3vw;
font-size: 15px;
}
.textB {
- width: 7vw;
+ width: 7.3vw;
font-size: 15px;
}
diff --git a/src/views/consume/bean/beanConsume.vue b/src/views/consume/bean/beanConsume.vue
index 000b01c..617ea62 100644
--- a/src/views/consume/bean/beanConsume.vue
+++ b/src/views/consume/bean/beanConsume.vue
@@ -6,36 +6,36 @@
:class="{ 'active-btn': activeTab === 'addBeanConsume' }"
@click="navigateTo('addBeanConsume')"
v-if="hasAdd"
- style="width: 6.5vw;"
+ style="min-width: 6.5vw;"
>
- 新增消耗
+ {{ t('consume.addBeanConsume') }}
- 直播
+ {{ t('consume.liveStream') }}
- 铁粉
+ {{ t('consume.dieHardFan') }}
- 文章/视频
+ {{ t('consume.articleVideo') }}
@@ -50,6 +50,8 @@ import {useRouter, useRoute} from 'vue-router';
import {storeToRefs} from 'pinia';
import {useAdminStore} from '@/store/index.js';
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
+import { useI18n } from 'vue-i18n';
+const { t } = useI18n();
const router = useRouter();
const route = useRoute();
diff --git a/src/views/consume/bean/dieHardFan.vue b/src/views/consume/bean/dieHardFan.vue
index aba8f1f..a3cdb44 100644
--- a/src/views/consume/bean/dieHardFan.vue
+++ b/src/views/consume/bean/dieHardFan.vue
@@ -8,6 +8,10 @@ import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
const adminStore = useAdminStore();
const { flag } = storeToRefs(adminStore);
+// 国际化
+import { useI18n } from 'vue-i18n';
+const { t } = useI18n();
+
// 监听全局flag状态变化
watch(flag, (newFlag, oldFlag) => {
// 当flag状态改变时,重新发送请求
@@ -68,7 +72,7 @@ const getChannel = async function () {
console.log('请求频道列表失败', error)
ElMessage({
type: 'error',
- message: '获取频道列表失败,请稍后重试'
+ message: t('elmessage.getChannelListFailed')
})
}
}
@@ -82,14 +86,14 @@ const getChannel = async function () {
// 抽离类型选项到响应式数组
const consumeTypes = ref([
- { label: '发礼物', value: 1 },
- { label: '发红包', value: 2 },
- { label: '发福袋', value: 3 },
- { label: '付费直播', value: 4 },
- { label: '加入粉丝团', value: 5 },
- { label: '发弹幕', value: 6 },
- { label: '单次付费', value: 7 },
- { label: '连续包月', value: 8 }
+ { label: t('consume.consumeTypes.1'), value: 1 },
+ { label: t('consume.consumeTypes.2'), value: 2 },
+ { label: t('consume.consumeTypes.3'), value: 3 },
+ { label: t('consume.consumeTypes.4'), value: 4 },
+ { label: t('consume.consumeTypes.5'), value: 5 },
+ { label: t('consume.consumeTypes.6'), value: 6 },
+ { label: t('consume.consumeTypes.7'), value: 7 },
+ { label: t('consume.consumeTypes.8'), value: 8 }
])
// // 处理类型选择变化
@@ -247,7 +251,7 @@ const search = function () {
if (beanConsumeFan.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(beanConsumeFan.value.jwcode)) {
- ElMessage.error('请检查精网号格式')
+ ElMessage.error(t('elmessage.checkJwcodeFormat'))
return
}
}
@@ -336,7 +340,7 @@ const getDept = async function () {
console.log('请求地区列表失败', error)
ElMessage({
type: 'error',
- message: '获取地区列表失败,请稍后重试'
+ message: t('elmessage.getRegionListFailed')
})
}
}
@@ -404,9 +408,16 @@ const exportExcel = async function () {
},
}
- const res = await API({ url: '/export/exportFan', data: params })
- if (res.code === 200) {
- ElMessage.success('导出成功')
+ try {
+ const res = await API({url: '/export/exportFan', data: params});
+ if (res.code === 200) {
+ ElMessage.success(t('elmessage.exportSuccess'));
+ } else {
+ ElMessage.error(res.message || t('elmessage.exportFailed'));
+ }
+ } catch (error) {
+ console.error('导出请求出错:', error);
+ ElMessage.error(t('elmessage.exportFailed'));
}
}
const exportListVisible = ref(false)
@@ -432,11 +443,11 @@ const getExportList = async () => {
});
exportList.value = filteredData
} else {
- ElMessage.error(result.msg || '获取导出列表失败')
+ ElMessage.error(result.msg || t('elmessage.getExportListError'))
}
} catch (error) {
console.error('获取导出列表出错:', error)
- ElMessage.error('获取导出列表失败,请稍后重试')
+ ElMessage.error(t('elmessage.getExportListError'))
} finally {
exportListLoading.value = false
}
@@ -449,7 +460,7 @@ const downloadExportFile = (item) => {
link.download = item.fileName
link.click()
} else {
- ElMessage.warning('文件还在导出中,请稍后再试')
+ ElMessage.warning(t('elmessage.exportingInProgress'))
}
}
//根据状态返回对应的标签类型
@@ -471,15 +482,15 @@ const getTagType = (state) => {
const getTagText = (state) => {
switch (state) {
case 0:
- return '待执行';
+ return t('elmessage.pendingExecution');
case 1:
- return '执行中';
+ return t('elmessage.executing');
case 2:
- return '执行完成';
+ return t('elmessage.executed');
case 3:
- return '执行出错';
+ return t('elmessage.errorExecution');
default:
- return '未知状态';
+ return t('elmessage.unknownStatus');
}
}
@@ -489,18 +500,18 @@ const getTagText = (state) => {
- 精网号:
-
+ {{ t('common.jwcode') }}:
+
- 地区:
-
+ {{ t('common.market') }}:
+
- 频道:
-
+ {{ t('common.channel') }}:
+
@@ -509,9 +520,9 @@ const getTagText = (state) => {
-
消费时间:
-
{{ t('common.consumetime') }}:
+
今
@@ -520,24 +531,24 @@ const getTagText = (state) => {
- 查询
- 导出Excel
- 查看导出列表
- 重置
+ {{ t('common.search') }}
+ {{ t('common.exportExcel') }}
+ {{ t('common.viewExportList') }}
+ {{ t('common.reset') }}
- 金豆总数:{{ format3(Math.abs(permanentBean + freeBean)) }}
- 付费金豆数:{{ format3(Math.abs(permanentBean)) }}
- 免费金豆数:{{ format3(Math.abs(freeBean)) }}
+ {{ t('common.totalGoldBean') }}{{ format3(Math.abs(permanentBean + freeBean)) }}
+ {{ t('common.payGoldBean') }}{{ format3(Math.abs(permanentBean)) }}
+ {{ t('common.freeGoldBean') }}{{ format3(Math.abs(freeBean)) }}
-
-
+
{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
@@ -545,20 +556,20 @@ const getTagText = (state) => {
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
- {{consumeTypes.find(item => item.value === Number(scope.row.type))?.label || '未知类型'}}
+ {{consumeTypes.find(item => item.value === Number(scope.row.type))?.label || t('common_list.unknownType')}}
-
+
@@ -571,33 +582,33 @@ const getTagText = (state) => {
-
+
-
-
+
+
{{ getTagText(scope.row.state) }}
-
+
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 下载
+ {{ t('common_export.download') }}
@@ -663,7 +674,7 @@ const getTagText = (state) => {
padding: 0 0.5vw;
.text {
- width: 5vw;
+ width: 5.3vw;
font-size: 15px;
}
diff --git a/src/views/consume/bean/liveStream.vue b/src/views/consume/bean/liveStream.vue
index fc237ce..b7cd3f8 100644
--- a/src/views/consume/bean/liveStream.vue
+++ b/src/views/consume/bean/liveStream.vue
@@ -6,6 +6,9 @@ import API from '@/util/http.js'
import moment from 'moment'
import {useAdminStore} from "@/store/index.js";
import {storeToRefs} from "pinia";
+// 国际化
+import { useI18n } from 'vue-i18n';
+const { t } = useI18n();
const adminStore = useAdminStore();
const {flag} = storeToRefs(adminStore);
@@ -73,7 +76,7 @@ const getGift = async function () {
console.log('请求礼物列表失败', error)
ElMessage({
type: 'error',
- message: '获取礼物列表失败,请稍后重试'
+ message: t('elmessage.getGiftListFailed')
})
}
}
@@ -95,19 +98,19 @@ const getChannel = async function () {
console.log('请求频道列表失败', error)
ElMessage({
type: 'error',
- message: '获取频道列表失败,请稍后重试'
+ message: t('elmessage.getChannelListFailed')
})
}
}
// 抽离类型选项到响应式数组
const consumeTypes = ref([
- {label: '发礼物', value: 1},
- {label: '发红包', value: 2},
- {label: '发福袋', value: 3},
- {label: '付费直播', value: 4},
- {label: '加入粉丝团', value: 5},
- {label: '发弹幕', value: 6}
+ {label: t('consume.consumeTypes.1'), value: 1},
+ {label: t('consume.consumeTypes.2'), value: 2},
+ {label: t('consume.consumeTypes.3'), value: 3},
+ {label: t('consume.consumeTypes.4'), value: 4},
+ {label: t('consume.consumeTypes.5'), value: 5},
+ {label: t('consume.consumeTypes.6'), value: 6}
])
// 处理类型选择变化
const handleTypeChange = (value) => {
@@ -160,7 +163,7 @@ const getDept = async function () {
console.log('请求地区列表失败', error)
ElMessage({
type: 'error',
- message: '获取地区列表失败,请稍后重试'
+ message: t('elmessage.getRegionListFailed')
})
}
}
@@ -289,7 +292,7 @@ const search = function () {
if (beanConsumeLive.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(beanConsumeLive.value.jwcode)) {
- ElMessage.error('请检查精网号格式')
+ ElMessage.error(t('elmessage.checkJwcodeFormat'))
return
}
}
@@ -435,13 +438,13 @@ const exportExcel = async function () {
const res = await API({url: '/export/exportLive', data: params});
console.log('导出请求响应:', res);
if (res.code === 200) {
- ElMessage.success('导出成功');
+ ElMessage.success(t('elmessage.exportSuccess'));
} else {
- ElMessage.error(res.message || '导出失败,请稍后重试');
+ ElMessage.error(res.message || t('elmessage.exportFailed'));
}
} catch (error) {
console.error('导出请求出错:', error);
- ElMessage.error('导出失败,请稍后重试');
+ ElMessage.error(t('elmessage.exportFailed'));
}
}
const exportListVisible = ref(false)
@@ -468,11 +471,11 @@ const getExportList = async () => {
});
exportList.value = filteredData
} else {
- ElMessage.error(result.msg || '获取导出列表失败')
+ ElMessage.error(result.msg || t('elmessage.getExportListError'))
}
} catch (error) {
console.error('获取导出列表出错:', error)
- ElMessage.error('获取导出列表失败,请稍后重试')
+ ElMessage.error(t('elmessage.getExportListError'))
} finally {
exportListLoading.value = false
}
@@ -485,7 +488,7 @@ const downloadExportFile = (item) => {
link.download = item.fileName
link.click()
} else {
- ElMessage.warning('文件还在导出中,请稍后再试')
+ ElMessage.warning(t('elmessage.exportingInProgress'))
}
}
//根据状态返回对应的标签类型
@@ -507,15 +510,15 @@ const getTagType = (state) => {
const getTagText = (state) => {
switch (state) {
case 0:
- return '待执行';
+ return t('elmessage.pendingExecution');
case 1:
- return '执行中';
+ return t('elmessage.executing');
case 2:
- return '执行完成';
+ return t('elmessage.executed');
case 3:
- return '执行出错';
+ return t('elmessage.errorExecution');
default:
- return '未知状态';
+ return t('elmessage.unknownStatus');
}
}
@@ -525,42 +528,42 @@ const getTagText = (state) => {
- 精网号:
-
+ {{ t('common.jwcode') }}:
+
- 地区:
-
+ {{ t('common.market') }}:
+
- 礼物名称:
- {{ t('common.giftName') }}:
+
-
- 频道:
-
+ {{ t('common.channel') }}:
+
-
-
直播间:
-
+
+ {{ t('common.liveRoom') }}:
+
-
消费时间:
-
{{ t('common.consumetime') }}:
+
今
@@ -569,24 +572,24 @@ const getTagText = (state) => {
- 查询
- 导出excel
- 查看导出列表
- 重置
+ {{ t('common.search') }}
+ {{ t('common.exportExcel') }}
+ {{ t('common.viewExportList') }}
+ {{ t('common.reset') }}
- 金豆总数:{{ format3(Math.abs(permanentBean + freeBean)) }}
- 付费金豆数:{{ format3(Math.abs(permanentBean)) }}
- 免费金豆数:{{ format3(Math.abs(freeBean)) }}
+ {{ t('common.totalGoldBean') }}{{ format3(Math.abs(permanentBean + freeBean)) }}
+ {{ t('common.payGoldBean') }}{{ format3(Math.abs(permanentBean)) }}
+ {{ t('common.freeGoldBean') }}{{ format3(Math.abs(freeBean)) }}
-
-
+
{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
@@ -594,23 +597,23 @@ const getTagText = (state) => {
-
+
-
-
-
+
+
+
-
-
+
+
- {{ scope.row.isBackpack == 1 ? '是' : '否' }}
+ {{ scope.row.isBackpack == 1 ? t('common_list.yes') : t('common_list.no') }}
-
-
-
-
-
+
+
+
+
+
{
-
+
-
-
+
+
{{ getTagText(scope.row.state) }}
-
+
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 下载
+ {{ t('common_export.download') }}
@@ -711,7 +714,7 @@ const getTagText = (state) => {
padding: 0 0.5vw;
.text {
- width: 5vw;
+ width: 5.3vw;
font-size: 15px;
}
diff --git a/src/views/consume/gold/addCoinConsume.vue b/src/views/consume/gold/addCoinConsume.vue
index a300c4e..57735ca 100644
--- a/src/views/consume/gold/addCoinConsume.vue
+++ b/src/views/consume/gold/addCoinConsume.vue
@@ -64,7 +64,8 @@ const addConsume = ref({
taskGold: null, // 任务金币
remark: "",//备注
adminId: null,// 当前管理员id
- adminName: adminData.value.adminName
+ adminName: adminData.value.adminName,
+ redMoney: 1 // 是否使用红包:1-使用,0-不使用
})
const Ref = ref(null)
const rules = reactive({
@@ -163,11 +164,16 @@ function validateInput() {
// 验证金币总和
const totalAvailableGold = (user.value.nowSumGold)
+ // 如果未勾选使用红包,则只校验消耗金币数是否超过可用金币数
if (user.value.jwcode && sumGold > totalAvailableGold) {
- ElMessage.error(t('elmessage.limitExceeded'));
- // 将sumGold设置为null
- addConsume.value.sumGold = null;
- return false;
+ // 如果未勾选使用红包,直接提示金币不足
+ if (addConsume.value.redMoney == 0) {
+ ElMessage.error(t('elmessage.limitExceeded'));
+ // 将sumGold设置为null
+ addConsume.value.sumGold = null;
+ return false;
+ }
+ // 如果勾选使用红包,且不满足原价条件,则会在validateRedLimit中提示
}
return true;
@@ -183,9 +189,12 @@ function validateRedLimit() {
ElMessage.error(t('elmessage.noEmptySumGold'));
return false;
}
- if (sumGold + redMax < price) {
- ElMessage.error(t('elmessage.limitRedAmount'));
- return false;
+ // 如果勾选使用红包,才需要校验消耗金币数 + 红包抵扣金额 ≥ 原价
+ if (addConsume.value.redMoney == 1) {
+ if (sumGold + redMax < price) {
+ ElMessage.error(t('elmessage.limitRedAmount'));
+ return false;
+ }
}
}
return true;
@@ -267,14 +276,15 @@ const add = async function () {
permanentGold: addConsume.value.permanentGold * 100,
goodsName: addConsume.value.goodsName.value,
remark: addConsume.value.remark,
- adminName: adminData.value.adminName
+ adminName: adminData.value.adminName,
+ redMoney: Number(addConsume.value.redMoney) // 1-使用红包,0-不使用红包
}
})
addDisabled.value = false
console.log("add请求", result);
// 处理响应
handleResponse(result);
-// 重置表单
+ // 重置表单
resetForm();
} catch (error) {
@@ -319,6 +329,7 @@ function resetForm() {
remark: "",
adminId: adminData.value.id,
adminName: adminData.value.adminName,
+ redMoney: 1 // 默认使用红包
}
console.log("重置表单")
@@ -592,9 +603,14 @@ onMounted(async function () {
-
+
+
+
+ 使用红包
+ 不使用红包
@@ -623,10 +639,10 @@ onMounted(async function () {
{{ t('common.reset')
- }}
+ }}
{{
t('common.submit')
- }}
+ }}
@@ -674,7 +690,7 @@ onMounted(async function () {
({{ $t('common_add_user.onlyStatisticsDataAfter20250101')
- }})
+ }})
@@ -767,8 +783,8 @@ onMounted(async function () {
-
+
@@ -819,7 +835,8 @@ onMounted(async function () {
{{ $t('common_add.similarRechargeRecords') }}
- · {{ ReadCookiesTime }} {{ $t('common_add.buy') }} 【{{ addConsume.goodsName.value }}】({{ $t('common_add.operator') }}: {{ adminData.adminName }})
+ · {{ ReadCookiesTime }} {{ $t('common_add.buy') }} 【{{ addConsume.goodsName.value }}】({{
+ $t('common_add.operator') }}: {{ adminData.adminName }})
{{ $t('common_add.continueOperation') }}
diff --git a/src/views/history/newHistory.vue b/src/views/history/newHistory.vue
index 35f5ee7..7923946 100644
--- a/src/views/history/newHistory.vue
+++ b/src/views/history/newHistory.vue
@@ -1,38 +1,38 @@
- 姓名:
- {{ t('common.name') }}:
+
- 精网号:
- {{ t('common.jwcode') }}:
+
- 更新时间:
-
+ {{ t('common.updateTime') }}:
+
- 查询
- 重置
+ {{ t('common.search') }}
+ {{ t('common.reset') }}
-
+
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
- 姓名:
- {{ t('common.name') }}:
+
- 精网号:
- {{ t('common.jwcode') }}:
+
- 更新时间:
-
+ {{ t('common.updateTime') }}:
+
- 查询
- 重置
+ {{ t('common.search') }}
+ {{ t('common.reset') }}
-
+
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
- 搜索:
-
+ {{ t('common.searchLabel') }}:
+
- 搜索
- 重置
+ {{ t('common.searchButton') }}
+ {{ t('common.reset') }}
@@ -17,20 +17,20 @@
- 添加
+ {{ t('common.add') }}
-
+ {{ t('common.batchImport') }}
-
+
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
-
+
@@ -40,7 +40,7 @@
-
+
@@ -52,13 +52,13 @@
- {{ scope.row.english ? '已翻译' : '未翻译' }}
+ {{ scope.row.english ? t('common_list.translated') : t('common_list.untranslated') }}
-
+
@@ -69,13 +69,13 @@
{{ scope.row.thai }}
- {{ scope.row.thai ? '已翻译' : '未翻译' }}
+ {{ scope.row.thai ? t('common_list.translated') : t('common_list.untranslated') }}
-
+
@@ -87,13 +87,13 @@
- {{ scope.row.chineseTraditional ? '已翻译' : '未翻译' }}
+ {{ scope.row.chineseTraditional ? t('common_list.translated') : t('common_list.untranslated') }}
-
+
@@ -104,13 +104,13 @@
{{ scope.row.malay }}
- {{ scope.row.malay ? '已翻译' : '未翻译' }}
+ {{ scope.row.malay ? t('common_list.translated') : t('common_list.untranslated') }}
-
+
@@ -122,24 +122,24 @@
- {{ scope.row.vietnamese ? '已翻译' : '未翻译' }}
+ {{ scope.row.vietnamese ? t('common_list.translated') : t('common_list.untranslated') }}
-
+
{{ moment(scope.row.configTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 编辑
- 删除
+ {{ t('common.edit') }}
+ {{ t('common.delete') }}
@@ -148,16 +148,9 @@
-
+
@@ -166,61 +159,54 @@
@cancel="handleDeleteCancel" @close="handleDeleteClose" />
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
- 取消
+ {{ t('common.cancel') }}
- {{ saveLoading ? '保存中...' : '保存' }}
+ {{ saveLoading ? t('common.saving') : t('common.save') }}
-
-
- 下载导入模板:
- 中文/英文/泰语/繁体中文/马来语/越南语模板
-
-
-
+
+
- 将文件拖到此处,或点击上传
+ {{ t('common.uploadHint') }}
- 取消
- 导入
+ {{ t('common.cancel') }}
+ {{ t('common.import') }}
@@ -273,7 +259,9 @@ const editForm = ref({
configTime: new Date()
})
-
+// 导入相关变量
+const uploadFile = ref(null)
+const importLoading = ref(false)
// 方法定义 防御性编程:函数内部再次检查可以确保即使在其他调用场景中也能正确处理数据
const truncateText = (text) => {
@@ -319,7 +307,7 @@ const getTranslationList = async () => {
}
} catch (error) {
console.error('获取翻译列表失败:', error)
- ElMessage.error('获取数据失败')
+ ElMessage.error(t('elmessage.requestFailed'))
}
}
@@ -364,7 +352,7 @@ const getMenuTree = async function () {
} catch (error) {
console.error('菜单数据请求失败:', error)
// return { code: 500, msg: '获取菜单失败' }
- ElMessage.error('网络异常')
+ ElMessage.error(t('elmessage.inNetworkError'))
adminStore.clearState()
}
// console.log('1')
@@ -379,7 +367,7 @@ const handleSave = async () => {
const fields = ['english', 'thai', 'chineseTraditional', 'malay', 'vietnamese']
for (const field of fields) {
if (editForm.value[field] && /<[^>]*>/.test(editForm.value[field])) {
- ElMessage.error('译文仅支持纯文本,不支持HTML标签')
+ ElMessage.error(t('elmessage.onlyPlainText'))
saveLoading.value = false // 校验失败,恢复按钮状态
return
}
@@ -396,7 +384,7 @@ const handleSave = async () => {
await getMenuTree()
if (res.code === 200) {
- ElMessage.success(editForm.value.id ? '编辑成功' : '添加成功')
+ ElMessage.success(editForm.value.id ? t('elmessage.editSuccess') : t('elmessage.addSuccess'))
showEditDialog.value = false
// getTranslationList()
@@ -406,14 +394,14 @@ const handleSave = async () => {
}, 500)
} else if (res.code === 0) {
// 处理后端返回的错误信息
- ElMessage.error(res.msg || '操作失败')
+ ElMessage.error(res.msg || t('elmessage.operationFailed'))
} else {
// 处理其他错误码
- ElMessage.error(res.msg || '操作失败')
+ ElMessage.error(res.msg || t('elmessage.operationFailed'))
}
} catch (error) {
console.error('保存失败:', error)
- ElMessage.error('保存失败')
+ ElMessage.error(t('elmessage.submitFailed'))
} finally {
// 无论成功还是失败,都恢复按钮状态
saveLoading.value = false
@@ -437,7 +425,7 @@ const handleDeleteConfirm = async () => {
// 点击删除后,刷新菜单树
await getMenuTree()
if (res.code === 200) {
- ElMessage.success('删除成功')
+ ElMessage.success(t('elmessage.deleteSuccess'))
// getTranslationList()
// 触发页面刷新以重新加载数据
setTimeout(() => {
@@ -446,7 +434,7 @@ const handleDeleteConfirm = async () => {
}
} catch (error) {
console.error('删除失败:', error)
- ElMessage.error('删除失败')
+ ElMessage.error(t('elmessage.operationFailed'))
} finally {
showDeleteDialog.value = false
currentDeleteRow.value = null
@@ -472,22 +460,72 @@ const handleBatchImport = () => {
showImportDialog.value = true
}
-// 下载模板
-const downloadTemplate = () => {
- // 这里实现下载模板的逻辑
- ElMessage.info('模板下载功能待实现')
-}
-
// 文件变化处理
const handleFileChange = (file) => {
- // 这里处理文件上传逻辑
- console.log('文件变化:', file)
+ // 验证文件类型
+ if (file.raw.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' &&
+ file.raw.type !== 'application/vnd.ms-excel') {
+ ElMessage.error(t('elmessage.onlyExcelAllowed'))
+ return
+ }
+ // 验证文件大小(限制为5MB)
+ if (file.raw.size > 5 * 1024 * 1024) {
+ ElMessage.error(t('elmessage.fileTooLarge5MB'))
+ return
+ }
+ // 存储文件
+ uploadFile.value = file.raw
+ ElMessage.success(t('elmessage.fileSelectSuccess'))
}
+// 添加文件超出限制的处理函数
+const handleExceed = (files, fileList) => {
+ ElMessage.warning(t('elmessage.uploadLimitOne'));
+};
+
// 导入处理
-const handleImport = () => {
- // 这里实现导入逻辑
- ElMessage.info('导入功能待实现')
+const handleImport = async () => {
+ if (!uploadFile.value) {
+ ElMessage.warning(t('elmessage.selectFileFirst'))
+ return
+ }
+
+ importLoading.value = true
+
+ try {
+ const formData = new FormData()
+ formData.append('file', uploadFile.value)
+
+ const res = await request({
+ url: '/language/batchImport',
+ method: 'POST',
+ data: formData,
+ headers: {
+ 'Content-Type': 'multipart/form-data' // 重要:设置正确的请求头
+ }
+ })
+
+ if (res.code === 200) {
+ ElMessage.success(t('elmessage.importSuccess'))
+ // 刷新菜单树(与保存、删除操作保持一致)
+ await getMenuTree()
+ // 触发页面刷新以重新加载数据
+ setTimeout(() => {
+ window.location.reload()
+ }, 500)
+ // 关闭导入对话框
+ showImportDialog.value = false
+ // 清空上传文件
+ uploadFile.value = null
+ } else {
+ ElMessage.error(res.msg || t('elmessage.importFailed'))
+ }
+ } catch (error) {
+ console.error('导入失败:', error)
+ ElMessage.error(t('elmessage.importFailedNetworkOrFormat'))
+ } finally {
+ importLoading.value = false
+ }
}
// 分页处理
@@ -586,4 +624,4 @@ onMounted(() => {
width: 100%;
height: 180px;
}
-
\ No newline at end of file
+
diff --git a/src/views/managerecharge/rate.vue b/src/views/managerecharge/rate.vue
index 149b19f..80d7c8b 100644
--- a/src/views/managerecharge/rate.vue
+++ b/src/views/managerecharge/rate.vue
@@ -1,13 +1,16 @@
@@ -191,22 +194,22 @@ const handleAddForm = async () => {
-
+
- 查询
+ {{ t('common.search') }}
-
+
-
+
-
+
- 重置
- 提交
+ {{ t('common.reset') }}
+ {{ t('common.submit') }}
@@ -215,12 +218,12 @@ const handleAddForm = async () => {
- 客户信息
+ {{ t('common_add_user.customerInfo') }}
-
姓名:
+
{{ t('common_add_user.name') }}:
{{ user.name }}
-
当前付费金豆:
+
{{ t('common_add_user.currentPayableBean') }}:
{{ Number(user.permanentBean) }}
@@ -228,17 +231,17 @@ const handleAddForm = async () => {
-
精网号:
+
{{ t('common.jwcode') }}:
{{ user.jwcode }}
-
当前免费金豆:
+
{{ t('common_add_user.currentFreeBean') }}:
{{ user.freeBean }}
-
所属门店:
+
{{ t('common_add_user.store') }}:
{{ user.market }}
-
消耗金豆总数:
+
{{ t('common_add_user.consumeTotalBean') }}:
{{ user.consumeSum }}
{{ 0 }}
@@ -273,7 +276,7 @@ const handleAddForm = async () => {
width: 35vw;
height: 28vh;
margin-top: 5vh;
- display: flex;
+ // display: flex;
justify-content: center;
}
}
diff --git a/src/views/recharge/bean/beanOnlineRecharge.vue b/src/views/recharge/bean/beanOnlineRecharge.vue
index 567839a..58276b7 100644
--- a/src/views/recharge/bean/beanOnlineRecharge.vue
+++ b/src/views/recharge/bean/beanOnlineRecharge.vue
@@ -6,6 +6,8 @@ import { AiFillRead } from 'vue-icons-plus/ai'
import axios from 'axios'
import moment from 'moment'
import API from '@/util/http.js'
+import {useI18n} from 'vue-i18n'
+const { t } = useI18n()
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
@@ -73,7 +75,7 @@ const getArea = async () => {
market.value = result.data
console.log('线上充值地区获取成功', market.value)
} else {
- ElMessage.error('线上充值地区获取失败')
+ ElMessage.error(t('elmessage.onlineRechargeAreaError'))
}
}
//获取今天日期
@@ -156,7 +158,7 @@ const search = () => {
if (selectData.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(selectData.value.jwcode)) {
- ElMessage.error('请检查精网号格式')
+ ElMessage.error(t('elmessage.checkJwcodeFormat'))
return
}
}
@@ -205,7 +207,7 @@ const platform = [
},
{
value: 2,
- label: '手机'
+ label: t('recharge.mobile')
}
]
//排序字段
@@ -258,13 +260,13 @@ const exportExcel = async () => {
try {
const res = await API({ url: '/export/exportol', data: params })
if (res.code === 200) {
- ElMessage.success('导出成功')
+ ElMessage.success(t('elmessage.exportSuccess'))
} else {
- ElMessage.error(res.message || '导出失败,请稍后重试')
+ ElMessage.error(res.message || t('elmessage.exportFailed'))
}
} catch (error) {
console.log('请求失败', error)
- ElMessage.error('导出失败,请稍后重试')
+ ElMessage.error(t('elmessage.exportFailed'))
}
}
const exportListVisible = ref(false)
@@ -294,7 +296,7 @@ const getExportList = async () => {
}
} catch (error) {
console.error('获取导出列表出错:', error)
- ElMessage.error('获取导出列表失败,请稍后重试')
+ ElMessage.error(t('elmessage.getExportListError'))
} finally {
exportListLoading.value = false
}
@@ -307,7 +309,7 @@ const downloadExportFile = (item) => {
link.download = item.fileName
link.click()
} else {
- ElMessage.warning('文件还在导出中,请稍后再试')
+ ElMessage.warning(t('elmessage.exportingInProgress'))
}
}
//根据状态返回对应的标签类型
@@ -329,15 +331,15 @@ const getTagType = (state) => {
const getTagText = (state) => {
switch (state) {
case 0:
- return '待执行';
+ return t('elmessage.pendingExecution');
case 1:
- return '执行中';
+ return t('elmessage.executing');
case 2:
- return '执行完成';
+ return t('elmessage.executed');
case 3:
- return '执行出错';
+ return t('elmessage.errorExecution');
default:
- return '未知状态';
+ return t('elmessage.unknownStatus');
}
}
const format3 = (num) => {
@@ -355,22 +357,22 @@ onMounted(async function () {
- 精网号:
-
+ {{ t('common.jwcode') }}:
+
- 所属地区:
-
+ {{ t('common.market') }}:
+
- 订单号:
-
+ {{ t('common.orderNo') }}:
+
- 充值平台:
-
+ {{ t('common.rechargePlatform') }}:
+
@@ -379,9 +381,9 @@ onMounted(async function () {
-
充值时间:
-
{{ t('common.rechargeTime') }}:
+
- 查询
- 导出Excel
- 查看导出列表
- 重置
+ {{ t('common.search') }}
+ {{ t('common.exportExcel') }}
+ {{ t('common.viewExportList') }}
+ {{ t('common.reset') }}
- 充值金豆数:{{ format3(num) }} 合计新币数:{{ format3(money) }}
+ {{ t('common.rechargeGoldBean') }}{{ format3(num) }} {{ t('common.totalRechargeSGD') }}{{ format3(money) }}
-
+
{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
PC
- 手机
- 其他
+ {{ t('common_list.mobile') }}
+ {{ t('common_list.other') }}
-
+
{{ moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') }}
@@ -449,33 +451,33 @@ onMounted(async function () {
-
+
-
-
+
+
{{ getTagText(scope.row.state) }}
-
+
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 下载
+ {{ t('common_export.download') }}
diff --git a/src/views/recharge/bean/beanRecharge.vue b/src/views/recharge/bean/beanRecharge.vue
index 052214c..f77fbc4 100644
--- a/src/views/recharge/bean/beanRecharge.vue
+++ b/src/views/recharge/bean/beanRecharge.vue
@@ -6,24 +6,24 @@
:class="{ 'active-btn': activeTab === 'addBeanRecharge' }"
@click="navigateTo('addBeanRecharge')"
v-if="hasAdd"
- style="width: 6.5vw">
- 新增充值
+ style="min-width: 6.5vw">
+ {{ t('recharge.addBeanRecharge') }}
- 系统充值
+ style="min-width: 6.5vw">
+ {{ t('recharge.systemRecharge') }}
- 线上充值
+ style="min-width: 6.5vw;">
+ {{ t('recharge.onlineRecharge') }}
@@ -37,6 +37,9 @@ import {useRouter, useRoute} from 'vue-router';
import {storeToRefs} from 'pinia';
import {useAdminStore} from '@/store/index.js';
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
+import {useI18n} from 'vue-i18n';
+const { t } = useI18n();
+
const router = useRouter();
const route = useRoute();
diff --git a/src/views/recharge/bean/beanSystemRecharge.vue b/src/views/recharge/bean/beanSystemRecharge.vue
index 7449e23..0756c26 100644
--- a/src/views/recharge/bean/beanSystemRecharge.vue
+++ b/src/views/recharge/bean/beanSystemRecharge.vue
@@ -10,6 +10,8 @@ import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
const adminStore = useAdminStore();
const { adminData, menuTree,flag } = storeToRefs(adminStore);
+import { useI18n } from 'vue-i18n'
+const { t } = useI18n()
// 监听全局flag状态变化
watch(flag, (newFlag, oldFlag) => {
@@ -87,7 +89,7 @@ const getArea = async () => {
market.value = result.data
console.log('系统充值地区获取成功', market.value)
} else {
- ElMessage.error('系统充值地区获取失败')
+ ElMessage.error(t('elmessage.systemRechargeAreaError'))
}
}
//获取今天日期
@@ -169,7 +171,7 @@ const search = () => {
if (selectData.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(selectData.value.jwcode)) {
- ElMessage.error('请检查精网号格式')
+ ElMessage.error(t('elmessage.checkJwcodeFormat'))
return
}
}
@@ -262,13 +264,13 @@ const exportExcel = async () => {
console.log('系统充值导出的参数为:', params);
if (res.code === 200) {
- ElMessage.success('导出成功')
+ ElMessage.success(t('elmessage.exportSuccess'))
} else {
- ElMessage.error(res.message || '导出失败,请稍后重试')
+ ElMessage.error(res.message || t('elmessage.exportFailed'))
}
} catch (error) {
console.log('请求失败', error)
- ElMessage.error('导出失败,请稍后重试')
+ ElMessage.error(t('elmessage.exportFailed'))
}
}
const exportListVisible = ref(false)
@@ -294,11 +296,11 @@ const getExportList = async () => {
});
exportList.value = filteredData
} else {
- ElMessage.error(result.msg || '获取导出列表失败')
+ ElMessage.error(result.msg || t('elmessage.getExportListError'))
}
} catch (error) {
console.error('获取导出列表出错:', error)
- ElMessage.error('获取导出列表失败,请稍后重试')
+ ElMessage.error(t('elmessage.getExportListError'))
} finally {
exportListLoading.value = false
}
@@ -311,7 +313,7 @@ const downloadExportFile = (item) => {
link.download = item.fileName
link.click()
} else {
- ElMessage.warning('文件还在导出中,请稍后再试')
+ ElMessage.warning(t('elmessage.exportingInProgress'))
}
}
//根据状态返回对应的标签类型
@@ -333,15 +335,15 @@ const getTagType = (state) => {
const getTagText = (state) => {
switch (state) {
case 0:
- return '待执行';
+ return t('elmessage.pendingExecution');
case 1:
- return '执行中';
+ return t('elmessage.executing');
case 2:
- return '执行完成';
+ return t('elmessage.executed');
case 3:
- return '执行出错';
+ return t('elmessage.errorExecution');
default:
- return '未知状态';
+ return t('elmessage.unknownStatus');
}
}
const format3 = (num) => {
@@ -359,12 +361,12 @@ onMounted(async function () {
- 精网号:
-
+ {{ t('common.jwcode') }}:
+
- 所属地区:
-
+ {{ t('common.market') }}:
+
@@ -373,9 +375,9 @@ onMounted(async function () {
-
充值时间:
-
{{ t('common.rechargeTime') }}:
+
-
查询
-
导出Excel
-
查看导出列表
-
重置
+
{{ t('common.search') }}
+
{{ t('common.exportExcel') }}
+
{{ t('common.viewExportList') }}
+
{{ t('common.reset') }}
- 金豆总数:{{ format3(beanNum) }}
- 付费金豆数:{{ format3(permanentBeans) }}
- 免费金豆数:{{ format3(freeBean) }}
+ {{ t('common.totalGoldBean') }}{{ format3(beanNum) }}
+ {{ t('common.payGoldBean') }}{{ format3(permanentBeans) }}
+ {{ t('common.freeGoldBean') }}{{ format3(freeBean) }}
-
+
{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{{ moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') }}
@@ -435,33 +437,33 @@ onMounted(async function () {
-
+
-
-
+
+
{{ getTagText(scope.row.state) }}
-
+
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
-
+
- 下载
+ {{ t('common_export.download') }}
diff --git a/src/views/refund/gold/addCoinRefund.vue b/src/views/refund/gold/addCoinRefund.vue
index dadb9db..0abb825 100644
--- a/src/views/refund/gold/addCoinRefund.vue
+++ b/src/views/refund/gold/addCoinRefund.vue
@@ -64,7 +64,7 @@ const cancel = function () {
const getRefund = async function () {
if (!addRefund.value.jwcode) {
- ElMessage.error(t('elmessage.checkJwCode'))
+ ElMessage.error(t('elmessage.checkJwcode'))
return
}
addRefund.value.orderCode = ''
diff --git a/src/views/usergold/bean/userbean.vue b/src/views/usergold/bean/userbean.vue
index eb685cb..7e2c176 100644
--- a/src/views/usergold/bean/userbean.vue
+++ b/src/views/usergold/bean/userbean.vue
@@ -1,40 +1,40 @@
- 精网号:
-
- 地区:
-
+ {{ t('common.jwcode') }}:
+
+ {{ t('common.market') }}:
+
- 查询
- 重置
+ {{ t('common.search') }}
+ {{ t('common.reset') }}
- 现有金豆数:{{ format3(stats.sumBean) }}金豆
- 付费金豆数:{{ format3(stats.permanentBean) }}金豆
- 免费金豆数:{{ format3(stats.freeBean) }}金豆
- 消费金豆总数:{{ format3(stats.consumeSum) }}金豆
+ {{ t('common.nowGoldBeanNum') }}{{ format3(stats.sumBean) }}{{ t('common.goldBean') }}
+ {{ t('common.payGoldBean') }}{{ format3(stats.permanentBean) }}{{ t('common.goldBean') }}
+ {{ t('common.freeGoldBean') }}{{ format3(stats.freeBean) }}{{ t('common.goldBean') }}
+ {{ t('common.consumeGoldBean') }}{{ format3(stats.consumeSum) }}{{ t('common.goldBean') }}
-
+
{{
scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize
}}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -56,7 +56,9 @@ const adminStore = useAdminStore();
const { adminData, menuTree, flag } = storeToRefs(adminStore);
import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js"
import { ElMessage } from 'element-plus';
-
+// 国际化
+import {useI18n} from 'vue-i18n'
+const {t} = useI18n()
// 监听全局flag状态变化
watch(flag, (newFlag, oldFlag) => {
// 当flag状态改变时,重新发送请求
@@ -96,7 +98,7 @@ const get = async function () {
if (searchObj.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(searchObj.value.jwcode)) {
- ElMessage.error('请检查精网号格式')
+ ElMessage.error(t('elmessage.checkJwcodeFormat'))
return
}
}
diff --git a/src/views/workspace/index.vue b/src/views/workspace/index.vue
index e808213..4aac2fa 100644
--- a/src/views/workspace/index.vue
+++ b/src/views/workspace/index.vue
@@ -1,7 +1,7 @@
@@ -15,7 +15,7 @@
- 加载中...
+ {{ t('workbench.loading') }}
@@ -30,6 +30,9 @@ import GoldGraphMarkets from "@/components/workspace/GoldGraphMarkets.vue";
import API from "@/util/http.js";
import {onMounted, ref} from "vue";
import GoldGraph from "@/components/workspace/GoldGraph.vue";
+import { useI18n } from 'vue-i18n'
+
+const { t } = useI18n()
const GraphFlag = ref();
const loading = ref(true); // 新增加载状态
@@ -39,7 +42,7 @@ const getAdminData = async function () {
loading.value = true; // 开始加载
const result = await API({url: '/admin/userinfo', data: {}});
GraphFlag.value = result.markets !== '总部' && result.markets !== '研发部'
- && result.markets !== 'headquarters' && result.markets !== 'R&D Department'
+ && result.markets !== 'Headquarters' && result.markets !== 'R&D Department'
;