From 8624adae7d7330551f5b87c7bb5ce15c58788c9f Mon Sep 17 00:00:00 2001
From: zhangrenyuan <18990852002@163.com>
Date: Sun, 30 Nov 2025 14:29:00 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E5=9C=A8=E5=A4=9A=E8=AF=AD?=
=?UTF-8?q?=E8=A8=80=E9=85=8D=E7=BD=AE=E4=BD=BF=E7=94=A8tree=E7=9A=84?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=E5=92=8C=E7=BC=93=E5=AD=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/consume/gold/addCoinConsume.vue | 2 +-
src/views/language/languageTranslate.vue | 71 ++++++++++++++++++++++---------
2 files changed, 52 insertions(+), 21 deletions(-)
diff --git a/src/views/consume/gold/addCoinConsume.vue b/src/views/consume/gold/addCoinConsume.vue
index 7e0e185..efd152f 100644
--- a/src/views/consume/gold/addCoinConsume.vue
+++ b/src/views/consume/gold/addCoinConsume.vue
@@ -577,7 +577,7 @@ onMounted(async function () {
{{ $t('common.个') }}
-
+
diff --git a/src/views/language/languageTranslate.vue b/src/views/language/languageTranslate.vue
index 66b9c04..cf04650 100644
--- a/src/views/language/languageTranslate.vue
+++ b/src/views/language/languageTranslate.vue
@@ -29,7 +29,7 @@
-
+
@@ -49,7 +49,8 @@
{{ scope.row.english }}
-
+
{{ scope.row.english ? '已翻译' : '未翻译' }}
@@ -83,7 +84,8 @@
{{ scope.row.chineseTraditional }}
-
+
{{ scope.row.chineseTraditional ? '已翻译' : '未翻译' }}
@@ -117,7 +119,8 @@
{{ scope.row.vietnamese }}
-
+
{{ scope.row.vietnamese ? '已翻译' : '未翻译' }}
@@ -151,40 +154,34 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -222,6 +219,11 @@ import API from "@/util/http.js"
import moment from 'moment'
import { UploadFilled } from '@element-plus/icons-vue'
import ConfirmDialog from '@/components/dialogs/ConfirmDialog.vue'
+// 引入AdminStore
+import { useAdminStore } from '@/store/index.js';
+import { storeToRefs } from "pinia";
+const adminStore = useAdminStore();
+const { adminData } = storeToRefs(adminStore);
// 响应式数据
const tableData = ref([])
@@ -334,9 +336,33 @@ const handleAdd = () => {
showEditDialog.value = true
}
+const getMenuTree = async function () {
+ // 获取菜单树
+ try {
+ const result = await request({
+ url: '/menu/tree',
+ data: {
+ id: adminData.value.roleId,
+
+ }
+ })
+ if (result.code === 200) {
+ adminStore.setMenuTree(result.data)
+
+ }
+
+ return result.data // 直接返回接口响应数据
+ } catch (error) {
+ console.error('菜单数据请求失败:', error)
+ // return { code: 500, msg: '获取菜单失败' }
+ ElMessage.error('网络异常')
+ adminStore.clearState()
+ }
+}
+
// 保存翻译
const handleSave = async () => {
- // 原文必填校验
+ // 原文必填校验
if (!editForm.value.chineseSimplified || editForm.value.chineseSimplified.trim() === '') {
ElMessage.error('原文为必填项')
return
@@ -373,6 +399,8 @@ const handleSave = async () => {
console.error('保存失败:', error)
ElMessage.error('保存失败')
}
+ // 点击保存后,刷新菜单树
+ await getMenuTree()
}
// 删除翻译 - 打开确认对话框
@@ -400,6 +428,8 @@ const handleDeleteConfirm = async () => {
showDeleteDialog.value = false
currentDeleteRow.value = null
}
+ // 点击删除后,刷新菜单树
+ await getMenuTree()
}
// 取消删除
@@ -502,7 +532,7 @@ onMounted(() => {
display: flex;
align-items: center;
gap: 4px;
-
+
}
@@ -512,6 +542,7 @@ onMounted(() => {
align-items: center;
gap: 4px;
margin-bottom: 1vh;
+
.add-item-export {
background-color: #5870FF;
color: white;