国际化批量编辑
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0a473dcae3
commit
9c964f11a1
45
src/App.vue
45
src/App.vue
|
@ -110,10 +110,12 @@ export default {
|
||||||
show: false,
|
show: false,
|
||||||
key: null,
|
key: null,
|
||||||
arr: [],
|
arr: [],
|
||||||
|
il8nExternal: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.show = process.env.VUE_APP_OSS_PATH === '/test/dist'
|
this.show = process.env.VUE_APP_OSS_PATH === '/test/dist'
|
||||||
|
Vue.prototype.$openI18n = this.openI18n
|
||||||
},
|
},
|
||||||
// watch: {
|
// watch: {
|
||||||
// '$route.query': {
|
// '$route.query': {
|
||||||
|
@ -181,22 +183,49 @@ export default {
|
||||||
i18n.mergeLocaleMessage('en', enMessages)
|
i18n.mergeLocaleMessage('en', enMessages)
|
||||||
this.drawer = false
|
this.drawer = false
|
||||||
this.$message.success('国际化修改成功')
|
this.$message.success('国际化修改成功')
|
||||||
|
if (this.il8nExternal) {
|
||||||
|
this.$EventBus.$emit('il8nUpdate')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
openI18n() {
|
openI18n(ARRAY) {
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
|
this.il8nExternal = false
|
||||||
this.key = null
|
this.key = null
|
||||||
this.drawer = true
|
this.drawer = true
|
||||||
let arr = []
|
let arr = []
|
||||||
let tableData = this.$tl.map((v) => {
|
let tableData = []
|
||||||
let a = { ...v }
|
if (ARRAY && Array.isArray(ARRAY)) {
|
||||||
// if (!a.Description) {
|
this.il8nExternal = true
|
||||||
// a.Description = this.$route.path
|
let data = ARRAY.map((v) => {
|
||||||
// }
|
let a = { ...v }
|
||||||
return a
|
|
||||||
})
|
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) => {
|
tableData = tableData.filter((v) => {
|
||||||
// return ~this.$path.indexOf(v.Description + '_' + v.Code)
|
// return ~this.$path.indexOf(v.Description + '_' + v.Code)
|
||||||
return ~this.$path.indexOf(v.Code)
|
return ~this.$path.indexOf(v.Code)
|
||||||
|
|
|
@ -154,6 +154,15 @@
|
||||||
>
|
>
|
||||||
批量更新
|
批量更新
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-edit-outline"
|
||||||
|
size="mini"
|
||||||
|
:disabled="selectTableList.length <= 0"
|
||||||
|
@click="handleBatchUpdateToChange"
|
||||||
|
>
|
||||||
|
批量编辑
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -380,6 +389,9 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getPublishVersionSelect()
|
this.getPublishVersionSelect()
|
||||||
|
this.$EventBus.$on('il8nUpdate', (data) => {
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取迭代
|
// 获取迭代
|
||||||
|
@ -416,6 +428,10 @@ export default {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 批量编辑国际化内容
|
||||||
|
handleBatchUpdateToChange() {
|
||||||
|
this.$openI18n(this.selectTableList)
|
||||||
|
},
|
||||||
async batch(row) {
|
async batch(row) {
|
||||||
let { PublishLogId, State } = row
|
let { PublishLogId, State } = row
|
||||||
let data = {
|
let data = {
|
||||||
|
|
|
@ -85,7 +85,6 @@ export default {
|
||||||
if (!this.JsonObj) return []
|
if (!this.JsonObj) return []
|
||||||
let obj = JSON.parse(this.JsonObj)
|
let obj = JSON.parse(this.JsonObj)
|
||||||
let curData = []
|
let curData = []
|
||||||
console.log(obj, 'obj')
|
|
||||||
Object.keys(obj).forEach((key) => {
|
Object.keys(obj).forEach((key) => {
|
||||||
if (this.curKeys.includes(key)) {
|
if (this.curKeys.includes(key)) {
|
||||||
let o = {
|
let o = {
|
||||||
|
|
Loading…
Reference in New Issue