增加后台批量编辑国际化翻译功能
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d3dd4ecffc
commit
3f2a339cba
68
src/App.vue
68
src/App.vue
|
@ -23,12 +23,38 @@
|
|||
>
|
||||
i18n
|
||||
</div>
|
||||
<el-drawer title="国际化" :visible.sync="drawer" direction="rtl" size="80%">
|
||||
<div style="width: 320px">
|
||||
<el-form label-width="100px" @submit.native.prevent size="small">
|
||||
<el-form-item label="关键字">
|
||||
<el-drawer
|
||||
:title="$t('il8n:title')"
|
||||
:visible.sync="drawer"
|
||||
direction="rtl"
|
||||
size="80%"
|
||||
>
|
||||
<div style="width: 620px">
|
||||
<el-form
|
||||
label-width="100px"
|
||||
@submit.native.prevent
|
||||
size="small"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
>
|
||||
<el-form-item :label="$t('il8n:search:keyword')">
|
||||
<el-input v-model="key" @input="keyChange" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('il8n:search:state')" v-if="il8nExternal">
|
||||
<el-select
|
||||
v-model="State"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleStateChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of $d.InternationalizationKeyState"
|
||||
:key="'InternationalizationKeyState' + item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
|
@ -39,7 +65,7 @@
|
|||
>
|
||||
<el-table-column
|
||||
prop="Code"
|
||||
label="标签"
|
||||
:label="$t('il8n:table:label')"
|
||||
width="300"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
|
@ -53,7 +79,7 @@
|
|||
<!-- {{scope.row.Description}}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="Value" label="英文">
|
||||
<el-table-column prop="Value" :label="$t('il8n:table:en')">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.Value"
|
||||
|
@ -66,7 +92,7 @@
|
|||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ValueCN" label="中文">
|
||||
<el-table-column prop="ValueCN" :label="$t('il8n:table:cn')">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.ValueCN"
|
||||
|
@ -79,6 +105,27 @@
|
|||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="ValueCN"
|
||||
:label="$t('il8n:table:state')"
|
||||
v-if="il8nExternal"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-model="scope.row.State"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
>
|
||||
<el-option
|
||||
v-for="item of $d.InternationalizationKeyState"
|
||||
:key="'InternationalizationKeyState' + item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
|
||||
<el-button size="mini" @click="drawer = false">取消 </el-button>
|
||||
|
@ -111,6 +158,7 @@ export default {
|
|||
key: null,
|
||||
arr: [],
|
||||
il8nExternal: false,
|
||||
State: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -147,6 +195,11 @@ export default {
|
|||
// },
|
||||
// },
|
||||
methods: {
|
||||
handleStateChange() {
|
||||
this.tableData.forEach((item) => {
|
||||
item.State = this.State
|
||||
})
|
||||
},
|
||||
changeValue(target, attr, e) {
|
||||
this.$set(target, attr, e)
|
||||
},
|
||||
|
@ -212,6 +265,7 @@ export default {
|
|||
Module: item.Module,
|
||||
Value: item.Value,
|
||||
ValueCN: item.ValueCN,
|
||||
State: item.State,
|
||||
}
|
||||
})
|
||||
this.tableData = Object.assign([], tableData)
|
||||
|
|
Loading…
Reference in New Issue