修改
This commit is contained in:
1 parent
866cb60801
commit
7fca37e2a6
3 files changed
+35
-24
No files matched your search
@@ -28,14 +28,14 @@
|
||||
<el-input clearable placeholder="请输入手机号" v-model="dataForm.phone"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN') && !roleCodes.includes('ROLE_ADMIN')" class="mb20">
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN')" class="mb20">
|
||||
<el-form-item :label="$t('sysuser.role')" prop="role">
|
||||
<el-select clearable multiple placeholder="请选择角色" v-model="dataForm.role">
|
||||
<el-option :key="item.roleId" :label="item.roleName" :value="item.roleId" v-for="item in roleData" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN') && !roleCodes.includes('ROLE_ADMIN')" class="mb20">
|
||||
<el-col :span="12" v-if="!roleCodes.includes('DEPT_ADMIN')" class="mb20">
|
||||
<el-form-item :label="$t('sysuser.post')" prop="post">
|
||||
<el-select clearable multiple placeholder="请选择岗位" v-model="dataForm.post">
|
||||
<el-option :key="item.postId" :label="item.postName" :value="item.postId" v-for="item in postData" />
|
||||
@@ -171,10 +171,7 @@ const dataRules = ref({
|
||||
{ validator: rule.chinese, trigger: "blur" },
|
||||
],
|
||||
deptId: [{ required: true, message: "部门不能为空", trigger: "blur" }],
|
||||
role:
|
||||
roleCodes.includes("DEPT_ADMIN") || roleCodes.includes("ROLE_ADMIN")
|
||||
? []
|
||||
: [{ required: true, message: "角色不能为空", trigger: "blur" }],
|
||||
role: roleCodes.includes("DEPT_ADMIN") ? [] : [{ required: true, message: "角色不能为空", trigger: "blur" }],
|
||||
// post: [{ required: true, message: '岗位不能为空', trigger: 'blur' }],
|
||||
// 手机号校验,不能为空、新增的时不能重复校验
|
||||
phone: [
|
||||
@@ -288,7 +285,7 @@ const getPostData = () => {
|
||||
postList().then((res) => {
|
||||
postData.value = res.data
|
||||
// 默认选择第一个
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !roleCodes.includes("ROLE_ADMIN") && !dataForm.userId) {
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !dataForm.userId) {
|
||||
dataForm.post = [res.data[0].postId]
|
||||
}
|
||||
})
|
||||
@@ -298,7 +295,7 @@ const getRoleData = () => {
|
||||
roleList().then((res) => {
|
||||
roleData.value = res.data
|
||||
// 默认选择第一个
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !roleCodes.includes("ROLE_ADMIN") && !dataForm.userId) {
|
||||
if (!roleCodes.includes("DEPT_ADMIN") && !dataForm.userId) {
|
||||
dataForm.role = [res.data[0].roleId]
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user