Commit fe13177a authored by shuiluo's avatar shuiluo

feat: 用户管理国际化完成

parent 49eca53c
......@@ -8,6 +8,8 @@
import { mapState } from 'vuex';
import { changeThemeColor } from '@/utils/themeUtil';
import langUtils from '@/utils/langUtils';
import en_USLang from 'ant-design-vue/es/locale-provider/en_US';
import zh_CNLang from 'ant-design-vue/es/locale-provider/zh_CN';
export default {
name: 'App',
......@@ -47,14 +49,13 @@ export default {
this.$i18n.locale = lang;
switch (lang) {
case 'zh_CN':
this.locale = require('ant-design-vue/es/locale-provider/zh_CN').default;
this.locale = zh_CNLang;
break;
case 'en_US':
this.locale = require('ant-design-vue/es/locale-provider/en_US').default;
this.locale = en_USLang;
break;
default:
this.locale = require('ant-design-vue/es/locale-provider/en_US').default;
break;
this.locale = zh_CNLang;
}
},
setHtmlTitle() {
......
......@@ -8,7 +8,10 @@
list-type="picture"
>
<slot>
<a-button v-if="fileList.length < number"> <a-icon type="upload" /> 上传 </a-button>
<a-button v-if="fileList.length < number">
<a-icon type="upload" />
{{ $t('user.upload') }}
</a-button>
</slot>
</a-upload>
</template>
......
......@@ -69,5 +69,24 @@ export default {
'system.organization': ['组织', 'Organization'],
'system.parentName': ['上级组织名称', 'Parent Organization Name'],
'system.jobs': ['岗位', 'Jobs'],
'system.organizationRoot': ['组织根目录', 'Organization Root']
'system.organizationRoot': ['组织根目录', 'Organization Root'],
'system.userConfig': ['用户配置', 'User Configuration'],
'system.previousStep': ['上一步', 'Previous Step'],
'system.nextStep': ['下一步', 'Next Step'],
'system.info': ['基本信息', 'Essential Information'],
'system.cerSet': ['证件设置', 'Certificate Setting'],
'system.postSet': ['岗位设置', 'Post Setting'],
'system.mustSetPost': ['必须设置岗位', 'Posts Must Be Set'],
'system.account': ['账号', 'Account'],
'system.role': ['角色', 'Role'],
'system.addCertificate': ['添加证件', 'Add Certificate'],
'system.certificateEditor': ['证件编辑', 'Certificate Editor'],
'system.certificateType': ['证件类型', 'Certificate Type'],
'system.certificateName': ['证件名称', 'Certificate Name'],
'system.certificateNumber': ['证件号码', 'Certificate Number'],
'system.issuingAuthority': ['发证机构', 'Issuing Authority'],
'system.term': ['有效期', 'Term Of Validity'],
'system.copyCertificate': ['证件副本', 'Copy Of Certificate'],
'system.addPosition': ['添加岗位', 'Add Position'],
'system.PartAndFulltime': ['兼职/全职', 'Part Time / Full Time'],
};
......@@ -77,4 +77,5 @@ export default {
'table.inspectionItems': ['巡检项目', 'Patrol Inspection Items'],
'table.errors': ['异常', 'Errors'],
'table.completionRate': ['完成率', 'Completion Rate'],
'table.submit': ['提交', 'Submit'],
};
......@@ -27,7 +27,7 @@
/>
</a-form-model-item>
<a-form-model-item :label="$t('order')" prop="viewIndex">
<a-input v-model="form.viewIndex" :disabled="isView" />
<a-input v-model="form.viewIndex" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item :label="$t('table.remark')" prop="remark">
<a-textarea
......
......@@ -4,7 +4,7 @@
<a-col>
<a-button type="primary" block @click="onAdd">
<a-icon type="plus-circle" />
添加证件
{{ $t('system.addCertificate') }}
</a-button>
</a-col>
<CertificateItem
......
<template>
<Drawer v-model="visible" title="证件编辑" destroyOnClose :width="500" :onOk="onOk">
<Drawer
v-model="visible"
:title="$t('system.certificateEditor')"
destroyOnClose
:width="500"
:onOk="onOk"
>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="CertificateFromRef">
<a-form-model-item label="证件类型" prop="certificateType">
<MySelect v-model="form.certificateType" :options="certificateTypeOption" />
<a-form-model-item :label="$t('system.certificateType')" prop="certificateType">
<MySelect
v-model="form.certificateType"
:options="certificateTypeOption"
:placeholder="$t('select.placeholder')"
/>
</a-form-model-item>
<a-form-model-item label="证件名称" prop="certificateName">
<a-input v-model="form.certificateName" />
<a-form-model-item :label="$t('system.certificateName')" prop="certificateName">
<a-input v-model="form.certificateName" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item label="证件号码" prop="certificateCode">
<a-input v-model="form.certificateCode" />
<a-form-model-item :label="$t('system.certificateNumber')" prop="certificateCode">
<a-input v-model="form.certificateCode" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
<a-form-model-item label="发证机构" prop="authorityDepartment">
<MySelect v-model="form.authorityDepartment" :options="authorityDepartmentOption" />
<a-form-model-item :label="$t('system.issuingAuthority')" prop="authorityDepartment">
<MySelect
v-model="form.authorityDepartment"
:options="authorityDepartmentOption"
:placeholder="$t('select.placeholder')"
/>
</a-form-model-item>
<a-form-model-item label="有效期" prop="expirationDate">
<a-date-picker class="tw-w-full" v-model="form.expirationDate" />
<a-form-model-item :label="$t('system.term')" prop="expirationDate">
<a-date-picker
class="tw-w-full"
v-model="form.expirationDate"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item>
<a-form-model-item label="证件副本" prop="pictureUrl">
<a-form-model-item :label="$t('system.copyCertificate')" prop="pictureUrl">
<Upload v-model="form.pictureUrl" showUploadList :number="1" />
</a-form-model-item>
</a-form-model>
......@@ -40,14 +58,10 @@ export default {
form: {},
rules: {
certificateType: [
{ required: true, message: 'Please select Activity zone', trigger: 'change' },
],
certificateName: [
{ required: true, message: 'Please select Activity zone', trigger: 'change' },
],
certificateCode: [
{ required: true, message: 'Please select Activity zone', trigger: 'change' },
{ required: true, message: this.$t('select.placeholder'), trigger: 'change' },
],
certificateName: [{ required: true, message: this.$t('input.error'), trigger: 'change' }],
certificateCode: [{ required: true, message: this.$t('input.error'), trigger: 'change' }],
// authorityDepartment: [
// { required: true, message: 'Please select Activity zone', trigger: 'change' },
// ],
......
......@@ -8,15 +8,15 @@
:src="value.pictureUrl && value.pictureUrl[0].thumbUrl"
/>
<template slot="actions" class="ant-card-actions">
<div class="tw-h-full" @click="onEdit">编辑</div>
<div class="tw-h-full" @click="onEdit">{{ $t('table.edit') }}</div>
<div class="tw-h-full">
<Del class="tw-h-full" :onOk="onDel" />
</div>
</template>
<a-card-meta :title="value.certificateName">
<template #description>
<div>证件号码{{ value.certificateCode }}</div>
<div>有效期{{ value.expirationDate }}</div>
<div>{{ $t('system.certificateNumber') }}{{ value.certificateCode }}</div>
<div>{{ $t('system.term') }}{{ value.expirationDate }}</div>
<div class="tw-mt-2">
<a-tag color="#f50" v-if="value.authorityDepartmentName">
{{ value.authorityDepartmentName }}
......@@ -40,14 +40,6 @@ export default {
props: {
value: Object,
},
watch: {
value: {
handler(val) {
console.log(val);
},
deep: true,
},
},
data() {
return {};
},
......
<template>
<a-input-group compact>
<a-input style="width: 30%" v-model="code" v-bind="$attrs" />
<a-input style="width: 70%" v-model="phone" v-bind="$attrs" />
<a-input style="width: 30%" v-model="code" v-bind="$attrs" :placeholder="$t('input.placeholder')" />
<a-input style="width: 70%" v-model="phone" v-bind="$attrs" :placeholder="$t('input.placeholder')" />
</a-input-group>
</template>
......
......@@ -4,7 +4,7 @@
<a-col>
<a-button type="primary" block @click="onAdd">
<a-icon type="plus-circle" />
添加岗位
{{ $t('system.addPosition') }}
</a-button>
</a-col>
<JobsItem
......
<template>
<Drawer v-model="visible" title="证件编辑" destroyOnClose :width="500" :onOk="onOk">
<Drawer v-model="visible" :title="$t('ystem.certificateEditor')" destroyOnClose :width="500" :onOk="onOk">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="JobsFormRef">
<a-form-model-item label="归属部门" prop="orgId">
<a-form-model-item :label="$t('table.organization')" prop="orgId">
<OrganizationTree v-model="form.orgId" :getName="getOrgName" />
</a-form-model-item>
<a-form-model-item label="岗位" prop="jobId">
<a-form-model-item :label="$t('system.jobs')" prop="jobId">
<RequestSelect
v-model="form.jobId"
:request="Api.getJobs"
......@@ -12,17 +12,17 @@
:getName="getJobName"
/>
</a-form-model-item>
<a-form-model-item label="兼职/全职" prop="isFull">
<a-form-model-item :label="$t('system.PartAndFulltime')" prop="isFull">
<ParameterSelect
staticKey="tfm_sys_user|isFull"
v-model="form.isFull"
:getName="getFullName"
/>
</a-form-model-item>
<a-form-model-item label="开始时间" prop="startDate">
<a-form-model-item :label="$t('select.startTime')" prop="startDate">
<a-date-picker class="tw-w-full" v-model="form.startDate" />
</a-form-model-item>
<a-form-model-item label="结束时间" prop="endDate">
<a-form-model-item :label="$t('select.endTime')" prop="endDate">
<a-date-picker class="tw-w-full" v-model="form.endDate" />
</a-form-model-item>
</a-form-model>
......@@ -47,11 +47,11 @@ export default {
visible: false,
form: {},
rules: {
orgId: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
jobId: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
isFull: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
startDate: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
endDate: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
orgId: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
jobId: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
isFull: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
startDate: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
endDate: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
},
formatData: { value: 'jobId', label: 'jobName', key: 'jobId' },
orgName: '',
......
......@@ -2,16 +2,16 @@
<a-col :span="12">
<a-card hoverable style="width: 100%">
<template slot="actions" class="ant-card-actions">
<div class="tw-h-full" @click="onEdit">编辑</div>
<div class="tw-h-full" @click="onEdit">{{ $t('table.edit') }}</div>
<div class="tw-h-full">
<Del class="tw-h-full" :onOk="onDel" />
</div>
</template>
<a-card-meta :title="`${value.orgName}[${value.jobName}]`">
<template #description>
<div>兼职/全职{{ value.isFullName }}</div>
<div>开始时间{{ value.startDate }}</div>
<div>结束时间{{ value.endDate }}</div>
<div>{{ $t('system.PartAndFulltime') }}{{ value.isFullName }}</div>
<div>{{ $t('select.startTime') }}{{ value.startDate }}</div>
<div>{{ $t('select.endTime') }}{{ value.endDate }}</div>
</template>
</a-card-meta>
</a-card>
......
<template>
<a-row :gutter="16">
<a-col :span="span">
<a-form-model-item label="账号" prop="loginId">
<a-input v-model="form.loginId" :disabled="isView" />
<a-form-model-item :label="$t('system.account')" prop="loginId">
<a-input v-model="form.loginId" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
</a-col>
<a-col :span="span">
<a-form-model-item label="名称" prop="userName">
<a-input v-model="form.userName" :disabled="isView" />
<a-form-model-item :label="$t('basic.name')" prop="userName">
<a-input v-model="form.userName" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="角色" prop="userRoleRelationList">
<a-form-model-item :label="$t('system.role')" prop="userRoleRelationList">
<RequestSelect
mode="multiple"
:formatData="formatRoleData"
......@@ -22,7 +22,7 @@
</a-form-model-item>
</a-col>
<a-col :span="span">
<a-form-model-item label="职称" prop="userTitle">
<a-form-model-item :label="$t('system.userTitleName')" prop="userTitle">
<ParameterSelect
staticKey="tfm_sys_user|userTitle"
v-model="form.userTitle"
......@@ -31,17 +31,17 @@
</a-form-model-item>
</a-col>
<a-col :span="span">
<a-form-model-item label="电子邮箱" prop="userEmail">
<a-input v-model="form.userEmail" :disabled="isView" />
<a-form-model-item :label="$t('user.email')" prop="userEmail">
<a-input v-model="form.userEmail" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
</a-col>
<a-col :span="span">
<a-form-model-item label="移动电话" prop="mobilePhone">
<a-input v-model="form.mobilePhone" :disabled="isView" />
<a-form-model-item :label="$t('user.mobilePhone')" prop="mobilePhone">
<a-input v-model="form.mobilePhone" :disabled="isView" :placeholder="$t('input.placeholder')" />
</a-form-model-item>
</a-col>
<a-col :span="span">
<a-form-model-item label="固定电话" prop="fixedPhone">
<a-form-model-item :label="$t('user.fixedPhone')" prop="fixedPhone">
<FixedPhone v-model="form.fixedPhone" :disabled="isView" />
</a-form-model-item>
</a-col>
......
......@@ -17,6 +17,5 @@ export default {
Api,
};
},
methods: {},
};
</script>
<template>
<Drawer ref="drawerRef" v-model="visible" title="用户配置">
<Drawer ref="drawerRef" v-model="visible" :title="$t('system.userConfig')">
<a-steps :current="current">
<a-step v-for="item in steps" :key="item.title" :title="item.title" />
</a-steps>
......@@ -10,9 +10,13 @@
<StepsThree v-if="current === 2" :form="form" />
</a-form-model>
<template #footer>
<a-button type="primary" @click="prev" v-if="current > 0"> 上一步 </a-button>
<a-button type="primary" @click="next" v-if="current < 2"> 下一步 </a-button>
<a-button type="primary" @click="onSubmit" v-if="current === 2"> 提交 </a-button>
<a-button type="primary" @click="prev" v-if="current > 0">
{{ $t('system.previousStep') }}
</a-button>
<a-button type="primary" @click="next" v-if="current < 2">{{ $t('system.nextStep') }}</a-button>
<a-button type="primary" @click="onSubmit" v-if="current === 2">
{{ $t('table.submit') }}
</a-button>
</template>
</Drawer>
</template>
......@@ -36,23 +40,23 @@ export default {
visible: false,
form: {},
rules: {
loginId: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
userName: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
loginId: [{ required: true, message: this.$t('input.error'), trigger: 'change' }],
userName: [{ required: true, message: this.$t('input.error'), trigger: 'change' }],
userRoleRelationList: [
{ required: true, message: 'Please select Activity zone', trigger: 'change' },
{ required: true, message: this.$t('select.placeholder'), trigger: 'change' },
],
userTitle: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
userTitle: [{ required: true, message: this.$t('select.placeholder'), trigger: 'change' }],
},
current: 0,
steps: [
{
title: '基本信息',
title: this.$t('system.info'),
},
{
title: '证件设置',
title: this.$t('system.cerSet'),
},
{
title: '岗位设置',
title: this.$t('system.postSet'),
},
],
Api,
......@@ -74,9 +78,8 @@ export default {
this.current--;
},
async onSubmit() {
console.log(this.form);
if (this.form.userJobRelationList.length === 0) {
this.$message.error('必须设置岗位!');
this.$message.error(this.$t('system.mustSetPost'));
return;
}
const userCertificateList = this.form.userCertificateList.map((i) => {
......@@ -94,7 +97,7 @@ export default {
await Api.addUser(data);
}
this.visible = false;
this.$message.success('操作成功');
this.$message.success(this.$t('table.operationSucceeded'));
this.refresh && this.refresh();
},
},
......
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