feat: acs国际化
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="模糊搜索"
|
||||
:placeholder="$t('menu.placeholder.fuzzy_search')"
|
||||
style="width: 200px;margin-bottom: 10px"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="queryBlurry"
|
||||
@@ -16,7 +16,7 @@
|
||||
<el-select
|
||||
v-model="query.system_type"
|
||||
style="width: 100px; height: 35px;top: -5px;"
|
||||
placeholder="所属系统"
|
||||
:placeholder="$t('menu.placeholder.owning_system')"
|
||||
@change="changetype"
|
||||
>
|
||||
<el-option
|
||||
@@ -81,15 +81,36 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " label="菜单可见" prop="hidden">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
<el-radio-button label="false">是</el-radio-button>
|
||||
<el-radio-button label="true">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="菜单标题" prop="title">
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="默认标题" prop="title">
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="菜单标题"
|
||||
placeholder="默认标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="中文标题" prop="zh_title">
|
||||
<el-input
|
||||
v-model="form.zh_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="中文标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="英文标题" prop="en_title">
|
||||
<el-input
|
||||
v-model="form.en_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="英文标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="印尼标题" prop="in_title">
|
||||
<el-input
|
||||
v-model="form.in_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="印尼标题"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="按钮名称" prop="title">
|
||||
@@ -149,46 +170,46 @@
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="菜单标题" prop="title" :min-width="100" />
|
||||
<el-table-column label="所属系统" prop="system_type" :min-width="flexWidth('system_type',crud.data,'所属系统')">
|
||||
<el-table-column :label="$t('menu.table_title.menu_title')" :prop="$langPre.computedProp('title')" :min-width="flexWidth($langPre.computedProp('title'),crud.data,$t('menu.table_title.menu_title'))" />
|
||||
<el-table-column :label="$t('menu.table_title.system')" prop="system_type" :min-width="flexWidth('system_type',crud.data,$t('menu.table_title.system'))">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.system_type[scope.row.system_type] }} : {{ scope.row.system_type }}
|
||||
{{ dict.label.system_type[scope.row.system_type] }} : {{scope.row.system_type}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="icon" label="图标" align="center" :min-width="flexWidth('icon',crud.data,'图标')">
|
||||
<el-table-column prop="icon" :label="$t('menu.table_title.icon')" align="center" :min-width="flexWidth('icon',crud.data, $t('menu.table_title.system'))">
|
||||
<template slot-scope="scope">
|
||||
<svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="menu_sort" align="center" label="排序" :min-width="flexWidth('menu_sort',crud.data,'排序')">
|
||||
<el-table-column prop="menu_sort" align="center" :label="$t('menu.table_title.sort')" :min-width="flexWidth('menu_sort',crud.data,$t('menu.table_title.sort'))">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.menu_sort }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="permission" label="权限标识" :min-width="flexWidth('permission',crud.data,'权限标识')" />
|
||||
<el-table-column prop="component" label="组件路径" min-width="120" />
|
||||
<el-table-column prop="iframe" label="外链" :formatter="crud.formatIsOrNot" :min-width="flexWidth('iframe',crud.data,'外链')">
|
||||
<el-table-column prop="permission" :label="$t('menu.table_title.permission_ident')" :min-width="flexWidth('permission',crud.data,$t('menu.table_title.permission_ident'))" />
|
||||
<el-table-column prop="component" :label="$t('menu.table_title.path')" min-width="120" />
|
||||
<el-table-column prop="iframe" :label="$t('menu.table_title.outside_chain')" :formatter="crud.formatIsOrNot" :min-width="flexWidth('iframe',crud.data,$t('menu.table_title.outside_chain'))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.iframe">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cache" label="缓存" :formatter="crud.formatIsOrNot" :min-width="flexWidth('cache',crud.data,'缓存')">
|
||||
<el-table-column prop="cache" :label="$t('menu.table_title.cache')" :formatter="crud.formatIsOrNot" :min-width="flexWidth('cache',crud.data,$t('menu.table_title.cache'))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.cache">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hidden" label="可见" :formatter="crud.formatIsOrNot" :min-width="flexWidth('hidden',crud.data,'可见')">
|
||||
<el-table-column prop="hidden" :label="$t('menu.table_title.visible')" :formatter="crud.formatIsOrNot" :min-width="flexWidth('hidden',crud.data,$t('menu.table_title.visible'))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.hidden">否</span>
|
||||
<span v-else>是</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建日期" :min-width="flexWidth('create_time',crud.data,'创建日期')" />
|
||||
<el-table-column prop="create_time" :label="$t('menu.table_title.create_time')" :min-width="flexWidth('create_time',crud.data,$t('menu.table_title.create_time'))" />
|
||||
<el-table-column
|
||||
v-permission="['admin','menu:edit','menu:del']"
|
||||
label="操作"
|
||||
:label="$t('common.Operate')"
|
||||
width="130px"
|
||||
align="center"
|
||||
fixed="right"
|
||||
@@ -197,7 +218,7 @@
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
||||
:msg="$t('menu.msg.delete_msg')"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -222,6 +243,9 @@ import Dict from '../../../components/Dict/Dict'
|
||||
const defaultForm = {
|
||||
menu_id: null,
|
||||
title: null,
|
||||
en_title: null,
|
||||
in_title: null,
|
||||
zh_title: null,
|
||||
menu_sort: 999,
|
||||
path: null,
|
||||
system_type: null,
|
||||
@@ -233,15 +257,15 @@ const defaultForm = {
|
||||
pid: 0,
|
||||
icon: null,
|
||||
cache: false,
|
||||
hidden: true,
|
||||
type: 0,
|
||||
hidden: false,
|
||||
type: 2,
|
||||
permission: null
|
||||
}
|
||||
export default {
|
||||
name: 'Menu',
|
||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }, sort: 'menu_sort,asc'})
|
||||
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['system_type'],
|
||||
@@ -259,6 +283,15 @@ export default {
|
||||
title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
zh_title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
en_title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
in_title: [
|
||||
{ required: true, message: '请输入标题', trigger: 'blur' }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '请输入地址', trigger: 'blur' }
|
||||
]
|
||||
|
||||
@@ -13,22 +13,22 @@
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-form-item :label="$t('SysParam.table.code')" prop="code">
|
||||
<el-input v-model="form.code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-form-item :label="$t('SysParam.table.name')" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="值" prop="value">
|
||||
<el-form-item :label="$t('SysParam.table.values')" prop="value">
|
||||
<el-input v-model="form.value" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-form-item :label="$t('SysParam.table.description')" prop="description">
|
||||
<el-input v-model="form.remark" style="width: 380px;" rows="5" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button type="text" @click="crud.cancelCU">{{ $t('common.Cancel') }}</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('common.Confirm') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -42,11 +42,11 @@
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="id" label="id" />
|
||||
<el-table-column prop="code" label="编码" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="name" label="名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="value" label="值" min-width="270" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column v-permission="['admin','param:edit','param:del']" label="操作" width="150px" align="center">
|
||||
<el-table-column prop="code" :label="$t('SysParam.table.code')" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column :prop="$langPre.computedProp('name')" :label="$t('SysParam.table.name')" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="value" :label="$t('SysParam.table.values')" min-width="270" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" :label="$t('SysParam.table.description')" />
|
||||
<el-table-column v-permission="['admin','param:edit','param:del']" :label="$t('common.Operate')" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '系统参数', url: 'api/param', idField: 'id', sort: 'id,desc', crudMethod: { ...crudParam },
|
||||
return CRUD({ title: 'menu.SystemParam', url: 'api/param', idField: 'id', sort: 'id,desc', crudMethod: { ...crudParam },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
@@ -102,23 +102,27 @@ export default {
|
||||
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('SysParam.rules.NotNull'), trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('SysParam.rules.NotNull'), trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('SysParam.rules.NotNull'), trigger: 'blur' }
|
||||
],
|
||||
value: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('SysParam.rules.NotNull'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
// computed: {
|
||||
// computedProp() {
|
||||
// // 在计算属性中拼接属性名
|
||||
// console.log(localStorage.getItem('lang'))
|
||||
// return localStorage.getItem('lang') + '_name'
|
||||
// }
|
||||
// },
|
||||
created() {
|
||||
// this.webSocket()
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<el-col :xs="24" :sm="24" :md="8" :lg="6" :xl="5" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>个人信息</span>
|
||||
<span>{{ $t('common.Personal_information') }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div style="text-align: center">
|
||||
@@ -19,15 +19,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<ul class="user-info">
|
||||
<li><div style="height: 100%"><svg-icon icon-class="login" /> 登录账号<div class="user-right">{{ user.username }}</div></div></li>
|
||||
<li><svg-icon icon-class="user1" /> 用户姓名 <div class="user-right">{{ user.person_name }}</div></li>
|
||||
<li><div style="height: 100%"><svg-icon icon-class="login" /> {{ $t('common.account') }}<div class="user-right">{{ user.username }}</div></div></li>
|
||||
<li><svg-icon icon-class="user1" /> {{ $t('common.username') }} <div class="user-right">{{ user.person_name }}</div></li>
|
||||
<!-- <li><svg-icon icon-class="dept" /> 所属部门 <div class="user-right"> {{ user.dept.name }}</div></li>-->
|
||||
<li><svg-icon icon-class="phone" /> 手机号码 <div class="user-right">{{ user.phone }}</div></li>
|
||||
<li><svg-icon icon-class="email" /> 用户邮箱 <div class="user-right">{{ user.email }}</div></li>
|
||||
<li><svg-icon icon-class="phone" /> {{ $t('common.phone') }} <div class="user-right">{{ user.phone }}</div></li>
|
||||
<li><svg-icon icon-class="email" /> {{ $t('common.email') }} <div class="user-right">{{ user.email }}</div></li>
|
||||
<li>
|
||||
<svg-icon icon-class="anq" /> 安全设置
|
||||
<svg-icon icon-class="anq" /> {{ $t('common.Security_settings') }}
|
||||
<div class="user-right">
|
||||
<a @click="$refs.pass.dialog = true">修改密码</a>
|
||||
<a @click="$refs.pass.dialog = true">{{ $t('common.Change_password') }}</a>
|
||||
<!-- <a @click="$refs.email.dialog = true">修改邮箱</a>-->
|
||||
</div>
|
||||
</li>
|
||||
@@ -39,35 +39,35 @@
|
||||
<!-- 用户资料 -->
|
||||
<el-card class="box-card">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="用户资料" name="first">
|
||||
<el-tab-pane :label="$t('common.User_information')" name="first">
|
||||
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 10px;" size="mini" label-width="65px">
|
||||
<el-form-item label="姓名" prop="person_name">
|
||||
<el-form-item :label="$t('common.name')" prop="person_name">
|
||||
<el-input v-model="form.person_name" style="width: 35%" />
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">用户姓名不作为登录使用</span>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">{{ $t('common.Tip3') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-form-item :label="$t('common.phone2')" prop="phone">
|
||||
<el-input v-model="form.phone" style="width: 35%;" />
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">手机号码不能重复</span>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">{{ $t('common.Tip4') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-form-item :label="$t('common.sex')">
|
||||
<el-radio-group v-model="form.gender" style="width: 178px">
|
||||
<el-radio label="男">男</el-radio>
|
||||
<el-radio label="女">女</el-radio>
|
||||
<el-radio :label="$t('common.sex_male')">{{ $t('common.sex_male') }}</el-radio>
|
||||
<el-radio :label="$t('common.sex_female')">{{ $t('common.sex_female') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button :loading="saveLoading" size="mini" type="primary" @click="doSubmit">保存配置</el-button>
|
||||
<el-button :loading="saveLoading" size="mini" type="primary" @click="doSubmit">{{ $t('common.Save_settings') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<!-- 操作日志 -->
|
||||
<el-tab-pane label="操作日志" name="second">
|
||||
<el-tab-pane :label="$t('common.Operation_log')" name="second">
|
||||
<el-table v-loading="loading" :data="data" style="width: 100%;">
|
||||
<el-table-column prop="description" label="行为" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="description" :label="$t('common.action')" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="request_ip" label="IP" />
|
||||
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="time" label="请求耗时" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="address" :label="$t('common.IP_source')" />
|
||||
<el-table-column prop="browser" :label="$t('common.Browser')" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="time" :label="$t('common.Request_time')" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
|
||||
@@ -80,7 +80,8 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template slot="header">
|
||||
<div style="display:inline-block;float: right;cursor: pointer" @click="init">创建日期<i class="el-icon-refresh" style="margin-left: 40px" /></div>
|
||||
<div style="display:inline-block;float: right;cursor: pointer" @click="init">
|
||||
{{ $t('common.Creation_date') }} <i class="el-icon-refresh" style="margin-left: 40px" /></div>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||
@@ -126,9 +127,9 @@ export default {
|
||||
// 自定义验证
|
||||
const validPhone = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error('请输入电话号码'))
|
||||
callback(new Error(this.$t('common.Tip5')))
|
||||
} else if (!isvalidPhone(value)) {
|
||||
callback(new Error('请输入正确的11位手机号码'))
|
||||
callback(new Error(this.$t('common.Tip6')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
@@ -202,24 +203,24 @@ export default {
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.avatar {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 50%;
|
||||
.avatar {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.user-info {
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
li{
|
||||
border-bottom: 1px solid #F0F3F4;
|
||||
padding: 11px 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
.user-info {
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
li{
|
||||
border-bottom: 1px solid #F0F3F4;
|
||||
padding: 11px 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
.user-right {
|
||||
float: right;
|
||||
a{
|
||||
color: #317EF3;
|
||||
}
|
||||
.user-right {
|
||||
float: right;
|
||||
a{
|
||||
color: #317EF3;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div style="display: inline-block">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="title" append-to-body width="500px" @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="88px">
|
||||
<el-form-item label="旧密码" prop="oldPass">
|
||||
<el-input v-model="form.oldPass" type="password" auto-complete="on" style="width: 370px;" />
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="30%">
|
||||
<el-form-item :label="$t('common.Old_password')" prop="oldPass">
|
||||
<el-input v-model="form.oldPass" type="password" auto-complete="on" style="width: 70%;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="newPass">
|
||||
<el-input v-model="form.newPass" type="password" auto-complete="on" style="width: 370px;" />
|
||||
<el-form-item :label="$t('common.New_password')" prop="newPass">
|
||||
<el-input v-model="form.newPass" type="password" auto-complete="on" style="width: 70%;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="confirmPass">
|
||||
<el-input v-model="form.confirmPass" type="password" auto-complete="on" style="width: 370px;" />
|
||||
<el-form-item :label="$t('common.Verify_password')" prop="confirmPass">
|
||||
<el-input v-model="form.confirmPass" type="password" auto-complete="on" style="width: 70%;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
<el-button type="text" @click="cancel">{{ $t('common.Cancel') }}</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">{{ $t('common.Confirm') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -23,28 +23,29 @@
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { updatePass } from '@/views/system/user/user'
|
||||
import i18n from '@/i18n'
|
||||
export default {
|
||||
data() {
|
||||
const confirmPass = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if (this.form.newPass !== value) {
|
||||
callback(new Error('两次输入的密码不一致'))
|
||||
callback(new Error(this.$t('common.Tip8')))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback(new Error('请再次输入密码'))
|
||||
callback(new Error(i18n.t('common.Tip9')))
|
||||
}
|
||||
}
|
||||
return {
|
||||
loading: false, dialog: false, title: '修改密码', form: { oldPass: '', newPass: '', confirmPass: '' },
|
||||
loading: false, dialog: false, title: i18n.t('common.Change_password'), form: { oldPass: '', newPass: '', confirmPass: '' },
|
||||
rules: {
|
||||
oldPass: [
|
||||
{ required: true, message: '请输入旧密码', trigger: 'blur' }
|
||||
{ required: true, message: i18n.t('common.Tip10'), trigger: 'blur' }
|
||||
],
|
||||
newPass: [
|
||||
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
|
||||
{ required: true, message: i18n.t('common.Tip11'), trigger: 'blur' },
|
||||
{ min: 6, max: 20, message: i18n.t('common.Tip12'), trigger: 'blur' }
|
||||
],
|
||||
confirmPass: [
|
||||
{ required: true, validator: confirmPass, trigger: 'blur' }
|
||||
|
||||
Reference in New Issue
Block a user