|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button type="primary" size="small" v-if="tool.checkAuth($route.name,'insertuser')" @click="dialogVisible = true">{{$t('新 建')}}</el-button>
|
|
|
- <el-drawer append-to-body :title="$t('新建')" :visible.sync="dialogVisible" :before-close="handleClose" v-if="tool.checkAuth($route.name,'insertuser')" size="800px">
|
|
|
+ <el-button type="primary" size="small" @click="dialogVisible = true">{{$t('新 建')}}</el-button>
|
|
|
+ <el-drawer append-to-body :title="$t('新建')" :visible.sync="dialogVisible" :before-close="handleClose" v-if="tool.checkAuth($route.name,'read')" size="800px">
|
|
|
<div class="drawer__panel">
|
|
|
<el-row :gutter="20">
|
|
|
<el-form ref="formInfo" :model="param.content" :rules="rules" :label-width="tool.onlyZh('90px')" label-position="right">
|
|
|
@@ -25,9 +25,9 @@
|
|
|
<el-input v-model="param.content.email" :placeholder="$t('请输入')" size="small"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" v-if="tool.checkAuth($route.name,'selectrole')">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item :label="`${$t(`角色配置`)}:`" prop="roleids">
|
|
|
- <el-select style="width:100%" v-model="param.content.roleids" multiple :disabled="!tool.checkAuth($route.name,'insertrole')" :placeholder="$t('请选择')" size="small">
|
|
|
+ <el-select style="width:100%" v-model="param.content.roleids" multiple :placeholder="$t('请选择')" size="small">
|
|
|
<el-option
|
|
|
v-for="(item,index) in checkList"
|
|
|
:key="index"
|
|
|
@@ -68,34 +68,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
dialogVisible: false,
|
|
|
- checkList: []
|
|
|
- };
|
|
|
- },
|
|
|
- props:['editTarget'],
|
|
|
- components: {
|
|
|
- },
|
|
|
- computed: {
|
|
|
- rules () {
|
|
|
- let rules = {
|
|
|
+ rules: {
|
|
|
name: [
|
|
|
{ required: true, message: this.$t('请输入名称'), trigger: 'blur' },
|
|
|
],
|
|
|
phonenumber: [
|
|
|
{ required: true, message: this.$t('请输入手机号'), trigger: 'blur' },
|
|
|
- { pattern:/^1[3-9]\\d{9}$/, message: this.$t('请输入正确手机号码'),trigger: 'blur' }
|
|
|
+ { pattern:/^1[3-9]\d{9}$/, message: this.$t('请输入正确手机号码'),trigger: 'blur' }
|
|
|
],
|
|
|
email: [
|
|
|
{ required: true, message: this.$t('请输入电子邮箱'), trigger: 'blur' },
|
|
|
- { pattern: /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/, message: this.$t('请输入正确电子邮箱'),trigger: 'blur' }
|
|
|
- ]
|
|
|
- }
|
|
|
- if (this.tool.checkAuth(this.$route.name, 'insertrole')) {
|
|
|
- rules.roleids = [
|
|
|
+ { pattern: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/, message: this.$t('请输入正确电子邮箱'),trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ roleids: [
|
|
|
{ required: true, message: this.$t('请选择你的权限'), trigger: 'blur' }
|
|
|
]
|
|
|
- }
|
|
|
- return rules
|
|
|
- }
|
|
|
+ },
|
|
|
+ checkList: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ props:['editTarget'],
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
},
|
|
|
watch: {
|
|
|
editTarget: {
|