Commit 6815675f authored by 陈浩玮's avatar 陈浩玮

Merge branch 'feature/shuiluo' into 'master'

Feature/shuiluo

See merge request product/kim3-web-vue/starter-web-vue!54
parents 5eb2a303 9ddea3b7
<template> <template>
<a-popconfirm :title="title" ok-text="确认" cancel-text="取消" @confirm="confirm"> <a-popconfirm
<a>{{ label }}</a> :title="title || $t('table.confirmDelete')"
:ok-text="$t('table.confirm')"
:cancel-text="$t('table.cancel')"
@confirm="confirm"
>
<a>{{ label || $t('table.delete') }}</a>
</a-popconfirm> </a-popconfirm>
</template> </template>
...@@ -17,7 +22,6 @@ export default { ...@@ -17,7 +22,6 @@ export default {
}, },
title: { title: {
type: String, type: String,
default: '确认是否删除',
}, },
onOk: { onOk: {
type: Function, type: Function,
...@@ -25,7 +29,6 @@ export default { ...@@ -25,7 +29,6 @@ export default {
}, },
label: { label: {
type: String, type: String,
default: '删除',
}, },
}, },
methods: { methods: {
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
<template> <template>
<a-divider /> <a-divider />
<a-space class="tw-justify-end"> <a-space class="tw-justify-end">
<a-button @click="cancel">取消</a-button> <a-button @click="cancel">{{ $t('table.cancel') }}</a-button>
<slot name="footer" v-if="!noFooter"> <slot name="footer" v-if="!noFooter">
<a-button type="primary" @click="ok" :loading="loading">确认</a-button> <a-button type="primary" @click="ok" :loading="loading">
{{ $t('table.confirm') }}
</a-button>
</slot> </slot>
</a-space> </a-space>
</template> </template>
......
...@@ -9,7 +9,7 @@ export default { ...@@ -9,7 +9,7 @@ export default {
'table.inspectionStartTime': ['巡检开始时间', 'InspectionStartTime'], 'table.inspectionStartTime': ['巡检开始时间', 'InspectionStartTime'],
'table.inspectionEndTime': ['巡检结束时间', 'InspectionEndTime'], 'table.inspectionEndTime': ['巡检结束时间', 'InspectionEndTime'],
'table.newTemporaryTask': ['新建临时任务', 'New Temporary Task'], 'table.newTemporaryTask': ['新建临时任务', 'New Temporary Task'],
'table.detail': ['详情', 'Detail'], 'table.details': ['详情', 'Details'],
'table.progress': ['进度', 'Progress'], 'table.progress': ['进度', 'Progress'],
'table.pleaseSelect': ['请选择需要导出的数据', 'Please select the data to export'], 'table.pleaseSelect': ['请选择需要导出的数据', 'Please select the data to export'],
'table.taskDetail': ['任务明细', 'Task Detail'], 'table.taskDetail': ['任务明细', 'Task Detail'],
...@@ -18,4 +18,14 @@ export default { ...@@ -18,4 +18,14 @@ export default {
content: ['内容', 'Content'], content: ['内容', 'Content'],
sender: ['发送者', 'Sender'], sender: ['发送者', 'Sender'],
recipient: ['接受者', 'Recipient'], recipient: ['接受者', 'Recipient'],
'table.organization': ['所属组织', 'Organization'],
'table.regionName': ['地区名称', 'RegionName'],
'table.remark': ['备注', 'Remark'],
'table.reviser': ['修改人', 'Reviser'],
'table.revisionTime': ['修改时间', 'Revision Time'],
'table.edit': ['编辑', 'Edit'],
'table.confirm': ['确认', 'Confirm'],
'table.cancel': ['取消', 'Cancel'],
'table.delete': ['删除', 'Delete'],
'table.confirmDelete': ['确认是否删除', 'Confirm To Delete']
}; };
...@@ -18,4 +18,10 @@ export default { ...@@ -18,4 +18,10 @@ export default {
'table.read': ['已读', 'Read'], 'table.read': ['已读', 'Read'],
'table.unread': ['未读', 'Unread'], 'table.unread': ['未读', 'Unread'],
'user.readTime': ['已读时间', 'Read Time'], 'user.readTime': ['已读时间', 'Read Time'],
'user.initialPassword': ['初始密码', 'Initial Password'],
'user.password': ['新密码', 'Password'],
'user.confirmPassword': ['确认密码', 'Confirm password'],
'user.twoInconsistent': ['两次密码不一致', 'The two passwords are inconsistent'],
'user.modifiedSuccessfully': ['修改成功', 'Modified successfully'],
'user.serverException': ['服务器异常', 'Server exception'],
}; };
<template> <template>
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView"> <Wraper :hidden="hidden" :onOk="submit" :refresh="refresh" :noFooter="isView">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form"> <a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="地区名称" prop="regionName"> <a-form-model-item :label="$t('table.regionName')" prop="regionName">
<a-input v-model="form.regionName" :disabled="isView" /> <a-input
v-model="form.regionName"
:disabled="isView"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="所属组织" prop="organizationId"> <a-form-model-item :label="$t('table.organization')" prop="organizationId">
<UrlSelect <UrlSelect
url="/api/v1/users/organizations" url="/api/v1/users/organizations"
labelFiled="orgName" labelFiled="orgName"
...@@ -15,8 +19,13 @@ ...@@ -15,8 +19,13 @@
/> />
</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 placeholder="Basic usage" :rows="4" v-model="form.remark" :disabled="isView" /> <a-textarea
:rows="4"
v-model="form.remark"
:disabled="isView"
:placeholder="$t('input.placeholder')"
/>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</Wraper> </Wraper>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
ref="table" ref="table"
> >
<template #search="{ query }"> <template #search="{ query }">
<MoreItem label="所属组织"> <MoreItem :label="$t('table.organization')">
<UrlSelect <UrlSelect
v-model="query.organizationId" v-model="query.organizationId"
url="/api/v1/users/organizations" url="/api/v1/users/organizations"
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
valueFiled="orgId" valueFiled="orgId"
/> />
</MoreItem> </MoreItem>
<MoreItem label="地区名称"> <MoreItem :label="$t('table.regionName')">
<a-input v-model="query.regionName" /> <a-input v-model="query.regionName" :placeholder="$t('input.placeholder')" />
</MoreItem> </MoreItem>
</template> </template>
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<AddAndEdit v-bind="drawer" /> <AddAndEdit v-bind="drawer" />
</template> </template>
<a-table-column title="地区名称" data-index="regionName" /> <a-table-column :title="$t('table.regionName')" data-index="regionName" />
<a-table-column title="所属组织" data-index="organizationName" /> <a-table-column :title="$t('table.organization')" data-index="organizationName" />
<a-table-column title="备注" data-index="remark" /> <a-table-column :title="$t('table.remark')" data-index="remark" />
<a-table-column title="修改人" data-index="editorName" /> <a-table-column :title="$t('table.reviser')" data-index="editorName" />
<a-table-column title="修改时间" data-index="editTime" /> <a-table-column :title="$t('table.revisionTime')" data-index="editTime" />
</Table> </Table>
</template> </template>
...@@ -43,8 +43,8 @@ export default { ...@@ -43,8 +43,8 @@ export default {
data() { data() {
return { return {
buttons: [ buttons: [
{ label: '编辑', click: this.edit }, { label: this.$t('table.edit'), click: this.edit },
{ label: '详情', click: this.view }, { label: this.$t('table.details'), click: this.view },
{ {
type: 'confirm', type: 'confirm',
url: (row) => `/ranger/inspection/api/v1/region/${row.regionId}`, url: (row) => `/ranger/inspection/api/v1/region/${row.regionId}`,
...@@ -58,10 +58,10 @@ export default { ...@@ -58,10 +58,10 @@ export default {
this.$refs.table.getData(); this.$refs.table.getData();
}, },
edit(row) { edit(row) {
this.$refs.table.show({ row, title: '编辑', type: 'edit' }); this.$refs.table.show({ row, title: this.$t('table.edit'), type: 'edit' });
}, },
view(row) { view(row) {
this.$refs.table.show({ row, title: '编辑', type: 'view' }); this.$refs.table.show({ row, title: this.$t('table.details'), type: 'view' });
}, },
}, },
}; };
......
<template> <template>
<a-form-model layout="vertical" style="width: 500px" :model="form" :rules="rules" ref="form"> <a-form-model layout="vertical" style="width: 500px" :model="form" :rules="rules" ref="form">
<a-form-model-item label="原始密码" prop="oldPassword"> <a-form-model-item :label="$t('user.initialPassword')" prop="oldPassword">
<a-input-password v-model="form.oldPassword" /> <a-input-password v-model="form.oldPassword" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="新密码" prop="newPassword"> <a-form-model-item :label="$t('user.password')" prop="newPassword">
<a-input-password v-model="form.newPassword" /> <a-input-password v-model="form.newPassword" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="确认新密码" prop="confirmPassword"> <a-form-model-item :label="$t('user.confirmPassword')" prop="confirmPassword">
<a-input-password v-model="form.confirmPassword" /> <a-input-password v-model="form.confirmPassword" />
</a-form-model-item> </a-form-model-item>
<a-form-model-item> <a-form-model-item>
<a-button type="primary" @click="modifyPassword" :loading="loading">修改密码</a-button> <a-button type="primary" @click="modifyPassword" :loading="loading">
{{ $t('user.modifyPassword') }}
</a-button>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</template> </template>
...@@ -21,7 +23,7 @@ import { EMPTY_FUN } from '@/utils'; ...@@ -21,7 +23,7 @@ import { EMPTY_FUN } from '@/utils';
import md5 from 'crypto-js/md5'; import md5 from 'crypto-js/md5';
export default { export default {
data: vm => ({ data: (vm) => ({
form: { form: {
newPassword: '', newPassword: '',
oldPassword: '', oldPassword: '',
...@@ -34,7 +36,7 @@ export default { ...@@ -34,7 +36,7 @@ export default {
{ required: true }, { required: true },
{ {
validator(rule, value, callback) { validator(rule, value, callback) {
if (value !== vm.form.newPassword) callback('两次密码不一致'); if (value !== vm.form.newPassword) callback(this.$t('user.twoInconsistent'));
callback(); callback();
}, },
}, },
...@@ -53,10 +55,10 @@ export default { ...@@ -53,10 +55,10 @@ export default {
newPassword: md5(this.form.newPassword).toString(), newPassword: md5(this.form.newPassword).toString(),
oldPassword: md5(this.form.oldPassword).toString(), oldPassword: md5(this.form.oldPassword).toString(),
}); });
this.$message.success('修改成功'); this.$message.success(this.$t('user.modifiedSuccessfully'));
} catch (error) { } catch (error) {
// todo // todo
this.$message.error('服务器异常'); this.$message.error(this.$t('user.serverException'));
} }
this.loading = false; this.loading = false;
}) })
......
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