Commit 677bfee1 authored by shuiluo's avatar shuiluo

feat: 参数管理国际化

parent 4b216178
......@@ -45,4 +45,16 @@ export default {
'log.businessModule': ['业务模块', 'Business Module'],
'log.operationService': ['操作服务', 'Operation Service'],
'log.operateTime': ['操作时间', 'Operate Time'],
'paramter.paramValue': ['参数值', 'Parameter Value'],
'paramter.paramValueError': ['请输入 @:paramter.paramValue', 'Please Input @:paramter.paramValue'],
'paramter.parameterCoding': ['参数编码', 'Parameter Coding'],
'paramter.parameterCodingError': [
'请输入 @:paramter.parameterCoding',
'Please Input @:paramter.parameterCoding',
],
'paramter.moduleParameters': ['参数模块', 'Module Parameters'],
'paramter.moduleParametersError': [
'请输入 @:paramter.moduleParameters',
'Please Input @:paramter.moduleParameters',
],
};
......@@ -34,8 +34,8 @@
<template #moreSearch="{ query }">
<MoreItem :label="$t('log.operationService')">
<a-select v-model="query.isSuccess" allowClear :placeholder="$t('select.placeholder')">
<a-select-option value="0">失败</a-select-option>
<a-select-option value="1">成功</a-select-option>
<a-select-option value="0">{{ $t('fail') }}</a-select-option>
<a-select-option value="1">{{ $t('success') }}</a-select-option>
</a-select>
</MoreItem>
</template>
......
<template>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item label="参数模块" prop="paramModule">
<a-input v-model="form.paramModule" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数编码" prop="paramCode">
<a-input v-model="form.paramCode" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数值" prop="paramValue">
<a-input v-model="form.paramValue" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="说明" prop="remark">
<a-textarea v-model="form.remark" :disabled="isView" :rows="4" />
</a-form-model-item>
</a-form-model>
<Wraper :hidden="hidden" :refresh="refresh" :onOk="submit">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item :label="$t('paramter.moduleParameters')" prop="paramModule">
<a-input v-model="form.paramModule" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item :label="$t('paramter.parameterCoding')" prop="paramCode">
<a-input v-model="form.paramCode" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item :label="$t('paramter.paramValue')" prop="paramValue">
<a-input v-model="form.paramValue" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea v-model="form.remark" :rows="4" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
</a-form-model>
</Wraper>
</template>
<script>
import Api from '@/api/organization';
import FormMixin from '@/components/FormMixin';
import { WraperMixins } from '@/components/table';
export default {
mixins: [FormMixin],
mixins: [WraperMixins],
data() {
return {
form: {},
rules: {
paramModule: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramCode: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramValue: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramIndex: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramModule: [{ required: true, message: this.$t('paramter.moduleParametersError') }],
paramCode: [{ required: true, message: this.$t('paramter.parameterCodingError') }],
paramValue: [{ required: true, message: this.$t('paramter.paramValueError') }],
},
};
},
methods: {
add() {
return Api.addOperation({ ...this.form });
computed: {
isEdit() {
return this.type === 'edit';
},
edit() {
return Api.updateOperation({ ...this.form });
},
mounted() {
if (this.type) {
this.form = { ...this.row };
}
},
methods: {
async submit() {
await this.$refs.form.validate();
return this.isEdit ? Api.updateOperation({ ...this.form }) : Api.addOperation({ ...this.form });
},
},
};
......
<template>
<my-table
url="/api/v1/parameters/operation"
rowKey="paramId"
:addBtn="addBtn"
ref="table"
:scroll="{ x: true }"
>
<template #drawer>
<Form ref="form" />
<Table url="/api/v1/parameters/operation" rowKey="paramId" addBtn ref="table" :buttons="buttons">
<template #drawer="drawer">
<Form v-bind="drawer" />
</template>
<template #search="{ query }">
<MyFormModelItem label="参数模块">
<a-input v-model="query.paramModule" placeholder="请输入" />
</MyFormModelItem>
<MyFormModelItem label="参数编码">
<a-input v-model="query.paramCode" placeholder="请输入" />
</MyFormModelItem>
<MyFormModelItem label="参数值">
<a-input v-model="query.paramValue" placeholder="请输入" />
</MyFormModelItem>
<MoreItem :label="$t('paramter.moduleParameters')">
<a-input v-model="query.paramModule" :placeholder="$t('input.placeholder')" />
</MoreItem>
<MoreItem :label="$t('paramter.parameterCoding')">
<a-input v-model="query.paramCode" :placeholder="$t('input.placeholder')" />
</MoreItem>
<MoreItem :label="$t('paramter.paramValue')">
<a-input v-model="query.paramValue" :placeholder="$t('input.placeholder')" />
</MoreItem>
</template>
<a-table-column title="参数模块" data-index="paramModule" />
<a-table-column title="参数编码" data-index="paramCode" />
<a-table-column title="参数值" data-index="paramValue" />
<a-table-column title="说明" data-index="remark" />
<a-table-column title="操作" fixed="right">
<template #default="row">
<a @click="() => view(row, 1)">编辑</a>
<a-divider type="vertical" />
<PopconfirmDelete :url="`/api/v1/parameters/operation/${row.paramId}`" :cb="refreshTable" />
</template>
</a-table-column>
</my-table>
<a-table-column :title="$t('paramter.moduleParameters')" data-index="paramModule" />
<a-table-column :title="$t('paramter.parameterCoding')" data-index="paramCode" />
<a-table-column :title="$t('paramter.paramValue')" data-index="paramValue" />
<a-table-column :title="$t('table.remark')" data-index="remark" />
</Table>
</template>
<script>
import PopconfirmDelete from '@/components/popconfirm_delete/index.vue';
import MyFormModelItem from '@/components/table/my_item.vue';
import { globalConfig } from '@/config';
import { formatObj } from '@/utils';
import Form from './form.vue';
import { Table, MoreItem } from '@/components/table';
export default {
components: { Form, PopconfirmDelete, MyFormModelItem },
data() {
return {
addBtn: { width: 600, onOk: () => this.$refs['form']?.submit() },
};
components: { Form, Table, MoreItem },
computed: {
buttons() {
return [
{ label: this.$t('table.edit'), click: this.edit },
{
type: 'confirm',
url: (row) => `/api/v1/parameters/operation/${row.paramId}`,
after: this.refreshTable,
},
];
},
},
methods: {
refreshTable() {
this.$refs['table']?.getData();
},
view(data, type) {
this.$refs['table']?.show({ type });
this.$nextTick(() => {
this.$refs['form'].setData({ ...data }, type);
});
edit(row) {
this.$refs['table']?.show({ row, title: this.$t('table.edit'), type: 'edit' });
},
},
};
</script>
\ No newline at end of file
</script>
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