From 9c964f11a10412b4692ce1a18930a5618c467179 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Fri, 10 Jan 2025 13:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 45 ++++++++++++++++++++++----- src/views/system/i18n/index.vue | 16 ++++++++++ src/views/system/login-log/detail.vue | 1 - 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/App.vue b/src/App.vue index bbc835a7..a3fcdc21 100644 --- a/src/App.vue +++ b/src/App.vue @@ -110,10 +110,12 @@ export default { show: false, key: null, arr: [], + il8nExternal: false, } }, mounted() { this.show = process.env.VUE_APP_OSS_PATH === '/test/dist' + Vue.prototype.$openI18n = this.openI18n }, // watch: { // '$route.query': { @@ -181,22 +183,49 @@ export default { i18n.mergeLocaleMessage('en', enMessages) this.drawer = false this.$message.success('国际化修改成功') + if (this.il8nExternal) { + this.$EventBus.$emit('il8nUpdate') + } } ) }) }, - openI18n() { + openI18n(ARRAY) { this.tableData = [] + this.il8nExternal = false this.key = null this.drawer = true let arr = [] - let tableData = this.$tl.map((v) => { - let a = { ...v } - // if (!a.Description) { - // a.Description = this.$route.path - // } - return a - }) + let tableData = [] + if (ARRAY && Array.isArray(ARRAY)) { + this.il8nExternal = true + let data = ARRAY.map((v) => { + let a = { ...v } + + return a + }) + tableData = data.map((item) => { + return { + Code: item.Code, + Description: item.Description, + FrontType: item.FrontType, + Module: item.Module, + Value: item.Value, + ValueCN: item.ValueCN, + } + }) + this.tableData = Object.assign([], tableData) + console.log(tableData) + return false + } else { + tableData = this.$tl.map((v) => { + let a = { ...v } + // if (!a.Description) { + // a.Description = this.$route.path + // } + return a + }) + } tableData = tableData.filter((v) => { // return ~this.$path.indexOf(v.Description + '_' + v.Code) return ~this.$path.indexOf(v.Code) diff --git a/src/views/system/i18n/index.vue b/src/views/system/i18n/index.vue index 65cbc3c6..b7886b1d 100644 --- a/src/views/system/i18n/index.vue +++ b/src/views/system/i18n/index.vue @@ -154,6 +154,15 @@ > 批量更新 + + 批量编辑 + { + this.getList() + }) }, methods: { // 获取迭代 @@ -416,6 +428,10 @@ export default { ) }) }, + // 批量编辑国际化内容 + handleBatchUpdateToChange() { + this.$openI18n(this.selectTableList) + }, async batch(row) { let { PublishLogId, State } = row let data = { diff --git a/src/views/system/login-log/detail.vue b/src/views/system/login-log/detail.vue index d28d8e86..f5e93903 100644 --- a/src/views/system/login-log/detail.vue +++ b/src/views/system/login-log/detail.vue @@ -85,7 +85,6 @@ export default { if (!this.JsonObj) return [] let obj = JSON.parse(this.JsonObj) let curData = [] - console.log(obj, 'obj') Object.keys(obj).forEach((key) => { if (this.curKeys.includes(key)) { let o = {