Commit 775f2127 authored by shuiluo's avatar shuiluo

feat: 设备管理国际化优化

parent a2d69b3f
...@@ -31,11 +31,11 @@ export default { ...@@ -31,11 +31,11 @@ export default {
this.form = { ...data }; this.form = { ...data };
this.type = type; this.type = type;
if (type === 0) { if (type === 0) {
this.title = '新增'; this.title = this.$t('table.add');
} else if (type === 1) { } else if (type === 1) {
this.title = '编辑'; this.title = this.$t('table.edit');
} else if (type === 2) { } else if (type === 2) {
this.title = '查看'; this.title = this.$t('table.view');
} else { } else {
this.title = ''; this.title = '';
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@cancel="close" @cancel="close"
> >
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm"> <a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item :label="$t('system.organizatio')" prop="catalogValue"> <a-form-model-item :label="$t('system.organization')" prop="catalogValue">
<OrganizationTree v-model="form.catalogValue" :disabled="isView" /> <OrganizationTree v-model="form.catalogValue" :disabled="isView" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
<Drawer ref="drawerRef" v-model="visible" :title="title" :onOk="submit" :colesAfter="colesAfter"> <Drawer ref="drawerRef" v-model="visible" :title="title" :onOk="submit" :colesAfter="colesAfter">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm"> <a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item :label="$t('oc.equipmentCode')" prop="equipmentId"> <a-form-model-item :label="$t('oc.equipmentCode')" prop="equipmentId">
<a-select v-model="form.equipmentId" :disabled="true" :options="options" /> <a-select
v-model="form.equipmentId"
:disabled="true"
:options="options"
:placeholder="$t('select.placeholder')"
/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item :label="$t('log.eventType')" prop="eventType"> <a-form-model-item :label="$t('log.eventType')" prop="eventType">
<MySelect <MySelect
...@@ -53,9 +58,7 @@ export default { ...@@ -53,9 +58,7 @@ export default {
watch: { watch: {
dataInfo: { dataInfo: {
handler(val) { handler(val) {
console.log(val);
const { catalogName, equipmentId } = val; const { catalogName, equipmentId } = val;
this.options = [{ value: equipmentId, label: catalogName, key: equipmentId }]; this.options = [{ value: equipmentId, label: catalogName, key: equipmentId }];
}, },
deep: true, deep: true,
...@@ -67,12 +70,10 @@ export default { ...@@ -67,12 +70,10 @@ export default {
visible: false, visible: false,
form: {}, form: {},
rules: { rules: {
equipmentId: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], equipmentId: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
eventType: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], eventType: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
occurTime: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], occurTime: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
eventDescription: [ eventDescription: [{ required: true, message: this.$t('input.error'), trigger: 'change' }],
{ required: true, message: 'Please select Activity zone', trigger: 'change' },
],
}, },
options: [], options: [],
getStaticDataApi, getStaticDataApi,
......
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