国际化批量编辑
continuous-integration/drone/push Build is passing Details

uat_us
wangxiaoshuang 2025-01-10 13:54:28 +08:00
parent 0a473dcae3
commit 9c964f11a1
3 changed files with 53 additions and 9 deletions

View File

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

View File

@ -154,6 +154,15 @@
>
批量更新
</el-button>
<el-button
type="primary"
icon="el-icon-edit-outline"
size="mini"
:disabled="selectTableList.length <= 0"
@click="handleBatchUpdateToChange"
>
批量编辑
</el-button>
<el-button
size="mini"
type="primary"
@ -380,6 +389,9 @@ export default {
mounted() {
this.getList()
this.getPublishVersionSelect()
this.$EventBus.$on('il8nUpdate', (data) => {
this.getList()
})
},
methods: {
//
@ -416,6 +428,10 @@ export default {
)
})
},
//
handleBatchUpdateToChange() {
this.$openI18n(this.selectTableList)
},
async batch(row) {
let { PublishLogId, State } = row
let data = {

View File

@ -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 = {