增加后台批量编辑国际化翻译功能
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
|
i18n
|
||||||
</div>
|
</div>
|
||||||
<el-drawer title="国际化" :visible.sync="drawer" direction="rtl" size="80%">
|
<el-drawer
|
||||||
<div style="width: 320px">
|
:title="$t('il8n:title')"
|
||||||
<el-form label-width="100px" @submit.native.prevent size="small">
|
:visible.sync="drawer"
|
||||||
<el-form-item label="关键字">
|
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-input v-model="key" @input="keyChange" />
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
|
@ -39,7 +65,7 @@
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="Code"
|
prop="Code"
|
||||||
label="标签"
|
:label="$t('il8n:table:label')"
|
||||||
width="300"
|
width="300"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
|
@ -53,7 +79,7 @@
|
||||||
<!-- {{scope.row.Description}}-->
|
<!-- {{scope.row.Description}}-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<el-table-column prop="Value" label="英文">
|
<el-table-column prop="Value" :label="$t('il8n:table:en')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.Value"
|
v-model="scope.row.Value"
|
||||||
|
@ -66,7 +92,7 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="ValueCN" label="中文">
|
<el-table-column prop="ValueCN" :label="$t('il8n:table:cn')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.ValueCN"
|
v-model="scope.row.ValueCN"
|
||||||
|
@ -79,6 +105,27 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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>
|
</el-table>
|
||||||
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
|
<div style="text-align: right; padding-top: 10px; padding-right: 10px">
|
||||||
<el-button size="mini" @click="drawer = false">取消 </el-button>
|
<el-button size="mini" @click="drawer = false">取消 </el-button>
|
||||||
|
@ -111,6 +158,7 @@ export default {
|
||||||
key: null,
|
key: null,
|
||||||
arr: [],
|
arr: [],
|
||||||
il8nExternal: false,
|
il8nExternal: false,
|
||||||
|
State: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -147,6 +195,11 @@ export default {
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
|
handleStateChange() {
|
||||||
|
this.tableData.forEach((item) => {
|
||||||
|
item.State = this.State
|
||||||
|
})
|
||||||
|
},
|
||||||
changeValue(target, attr, e) {
|
changeValue(target, attr, e) {
|
||||||
this.$set(target, attr, e)
|
this.$set(target, attr, e)
|
||||||
},
|
},
|
||||||
|
@ -212,6 +265,7 @@ export default {
|
||||||
Module: item.Module,
|
Module: item.Module,
|
||||||
Value: item.Value,
|
Value: item.Value,
|
||||||
ValueCN: item.ValueCN,
|
ValueCN: item.ValueCN,
|
||||||
|
State: item.State,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.tableData = Object.assign([], tableData)
|
this.tableData = Object.assign([], tableData)
|
||||||
|
|
Loading…
Reference in New Issue