Commit 503779fb authored by shuiluo's avatar shuiluo

feat: 业务参数页面国际化完成

parent 635894d4
...@@ -58,6 +58,12 @@ export default { ...@@ -58,6 +58,12 @@ export default {
'Please Input @:paramter.moduleParameters', 'Please Input @:paramter.moduleParameters',
], ],
language: ['语言', 'Language'], language: ['语言', 'Language'],
languageInputError: ['请输入@:language', 'Please Input @:language'],
'business.parameterName': ['参数名称', 'Parameter Name'], 'business.parameterName': ['参数名称', 'Parameter Name'],
'business.parameterNameError': [
'请输入@:business.parameterName',
'Please Input @:business.parameterName',
],
order: ['顺序', 'Order'], order: ['顺序', 'Order'],
orderInputError: ['请输入@:order', 'Please Input @:order'],
}; };
<template> <template>
<a-select v-bind="$attrs" v-on="$listeners" :options="langList" :placeholder="$t('select.placeholder')" /> <a-select
:value="value"
v-bind="$attrs"
v-on="$listeners"
:options="langList"
:placeholder="$t('select.placeholder')"
/>
</template> </template>
<script> <script>
......
<template> <template>
<Wraper :hidden="hidden" :refresh="refresh" :onOk="submit"> <Wraper :hidden="hidden" :refresh="refresh" :onOk="submit">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm"> <a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="语言" prop="paramLocale"> <a-form-model-item :label="$t('language')" prop="paramLocale">
<language v-model="form.paramLocale" /> <Language v-model="form.paramLocale" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="参数模块" prop="paramModule"> <a-form-model-item :label="$t('paramter.moduleParameters')" prop="paramModule">
<a-input v-model="form.paramModule" placeholder="请输入" :disabled="isView" /> <a-input v-model="form.paramModule" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="参数编码" prop="paramCode"> <a-form-model-item :label="$t('paramter.parameterCoding')" prop="paramCode">
<a-input v-model="form.paramCode" placeholder="请输入" :disabled="isView" /> <a-input v-model="form.paramCode" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="参数值" prop="paramValue"> <a-form-model-item :label="$t('paramter.paramValue')" prop="paramValue">
<a-input v-model="form.paramValue" placeholder="请输入" :disabled="isView" /> <a-input v-model="form.paramValue" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="参数名称" prop="paramName"> <a-form-model-item :label="$t('business.parameterName')" prop="paramName">
<a-input v-model="form.paramName" placeholder="请输入" :disabled="isView" /> <a-input v-model="form.paramName" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="显示顺序" prop="paramIndex"> <a-form-model-item :label="$t('order')" prop="paramIndex">
<a-input v-model="form.paramIndex" placeholder="请输入" :disabled="isView" /> <a-input v-model="form.paramIndex" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="说明" prop="remark"> <a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea v-model="form.remark" :disabled="isView" :rows="4" /> <a-textarea v-model="form.remark" :rows="4" :placeholder="$t('input.placeholder')" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</Wraper> </Wraper>
...@@ -28,36 +28,41 @@ ...@@ -28,36 +28,41 @@
<script> <script>
import Api from '@/api/organization'; import Api from '@/api/organization';
import FormMixin from '@/components/FormMixin';
import { WraperMixins } from '@/components/table'; import { WraperMixins } from '@/components/table';
import Language from './components/language.vue'; import Language from './components/language.vue';
export default { export default {
mixins: [FormMixin, WraperMixins], mixins: [WraperMixins],
components: { Language }, components: { Language },
data() { data() {
return { return {
form: {},
rules: { rules: {
paramLocale: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramLocale: [{ required: true, message: this.$t('languageInputError') }],
paramModule: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramModule: [{ required: true, message: this.$t('paramter.moduleParametersError') }],
paramCode: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramCode: [{ required: true, message: this.$t('paramter.parameterCodingError') }],
paramValue: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramValue: [{ required: true, message: this.$t('paramter.paramValueError') }],
paramName: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramName: [{ required: true, message: this.$t('business.parameterNameError') }],
paramIndex: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramIndex: [{ required: true, message: this.$t('orderInputError') }],
}, },
langList: [],
}; };
}, },
computed: {
methods: { isEdit() {
add() { return this.type === 'eidt';
return Api.addBusiness({ ...this.form }); },
}, },
edit() {
return Api.updateBusiness({ ...this.form }); mounted() {
if (this.type) {
this.form = { ...this.row };
}
}, },
methods: {
async submit() { async submit() {
await this.$refs.validate(); await this.$refs.form.validate();
return this.isEdit ? Api.updateBusiness({ ...this.form }) : Api.addBusiness({ ...this.form });
}, },
}, },
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment