部分问题修复
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
parent
7f713f2cfc
commit
4718373f08
|
@ -13,7 +13,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('common:action:action')" min-width="120px">
|
<el-table-column :label="$t('common:action:action')" min-width="120px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope" v-if="checkRole(scope.row.UserTypeEnum)">
|
||||||
<el-button size="mini" type="text" :disabled="scope.row.IsUserRoleDisabled"
|
<el-button size="mini" type="text" :disabled="scope.row.IsUserRoleDisabled"
|
||||||
@click.stop="scope.row.IsUserRoleDisabled = true">
|
@click.stop="scope.row.IsUserRoleDisabled = true">
|
||||||
{{ $fd('IsEnable', false) }}
|
{{ $fd('IsEnable', false) }}
|
||||||
|
@ -110,6 +110,11 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkRole(UserTypeEnum) {
|
||||||
|
if (this.hasPermi(['role:ga']) && [14, 2].includes(UserTypeEnum)) return false
|
||||||
|
if (this.hasPermi(['role:oa']) && [2].includes(UserTypeEnum)) return false
|
||||||
|
return true
|
||||||
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.$emit('update:visible', false)
|
this.$emit('update:visible', false)
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<!-- 账号信息 -->
|
<!-- 账号信息 -->
|
||||||
{{ $t("trials:trials-myinfo:title:accountInfo") }}
|
{{ $t("trials:trials-myinfo:title:accountInfo") }}
|
||||||
</div>
|
</div>
|
||||||
<el-form label-position="right" label-width="100px">
|
<el-form label-position="right" label-width="100px" ref="userForm" :model="userForm" :rules="rules">
|
||||||
<!-- 用户名 -->
|
<!-- 用户名 -->
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:userName')" style="margin-bottom: 5px" prop="UserName">
|
<el-form-item :label="$t('trials:trials-myinfo:form:userName')" style="margin-bottom: 5px" prop="UserName">
|
||||||
<span>{{ user.UserName }}</span>
|
<span>{{ user.UserName }}</span>
|
||||||
|
@ -31,10 +31,10 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 电话 -->
|
<!-- 电话 -->
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:phone')" style="margin-bottom: 5px" prop="UserName">
|
<el-form-item :label="$t('trials:trials-myinfo:form:phone')" style="margin-bottom: 5px" prop="Phone">
|
||||||
<span>{{ user.Phone }}</span>
|
<span>{{ user.Phone }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" style="position: relative" prop="UserName">
|
<el-form-item label="" style="position: relative">
|
||||||
<el-input v-model="userForm.Phone" :placeholder="$t('trials:trials-myinfo:form:phone')" />
|
<el-input v-model="userForm.Phone" :placeholder="$t('trials:trials-myinfo:form:phone')" />
|
||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<el-button :disabled="!userForm.Phone" class="saveBtn" type="primary" size="small" @click="setNewPhone">
|
<el-button :disabled="!userForm.Phone" class="saveBtn" type="primary" size="small" @click="setNewPhone">
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 邮箱 -->
|
<!-- 邮箱 -->
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:email')" style="margin-bottom: 5px" prop="UserName">
|
<el-form-item :label="$t('trials:trials-myinfo:form:email')" style="margin-bottom: 5px">
|
||||||
<span>{{ user.EMail }}</span>
|
<span>{{ user.EMail }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" style="margin-bottom: 10px; position: relative" prop="EMail" v-if="IsCanConnectInternet">
|
<el-form-item label="" style="margin-bottom: 10px; position: relative" prop="EMail" v-if="IsCanConnectInternet">
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
<el-button class="sendCode" :disabled="sendDisabled" type="primary" size="mini"
|
<el-button class="sendCode" :disabled="sendDisabled" type="primary" size="mini"
|
||||||
@click="sendVerificationCode">{{ sendTitle }}</el-button>
|
@click="sendVerificationCode">{{ sendTitle }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" style="position: relative" prop="VerificationCode" v-if="IsCanConnectInternet">
|
<el-form-item label="" style="position: relative" v-if="IsCanConnectInternet">
|
||||||
<el-input v-model="userForm.VerificationCode" :placeholder="$t('trials:researchForm:form:verifyCode')" />
|
<el-input v-model="userForm.VerificationCode" :placeholder="$t('trials:researchForm:form:verifyCode')" />
|
||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<el-button :disabled="!userForm.EMail || !userForm.VerificationCode
|
<el-button :disabled="!userForm.EMail || !userForm.VerificationCode
|
||||||
|
@ -59,8 +59,7 @@
|
||||||
{{ $t("trials:trials-myinfo:button:update") }}
|
{{ $t("trials:trials-myinfo:button:update") }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:toggleRole')" style="position: relative"
|
<el-form-item :label="$t('trials:trials-myinfo:form:toggleRole')" style="position: relative" v-if="hasRole">
|
||||||
prop="VerificationCode" v-if="hasRole">
|
|
||||||
<el-radio-group v-model="userRoleId" class="roles" v-if="hasRole">
|
<el-radio-group v-model="userRoleId" class="roles" v-if="hasRole">
|
||||||
<el-radio v-for="item in roles" :key="item.Id" :label="item.Id" :disabled="item.IsUserRoleDisabled"
|
<el-radio v-for="item in roles" :key="item.Id" :label="item.Id" :disabled="item.IsUserRoleDisabled"
|
||||||
style="margin-bottom: 10px">
|
style="margin-bottom: 10px">
|
||||||
|
@ -112,6 +111,56 @@ export default {
|
||||||
sendTitle: this.$t("trials:trials-myinfo:button:getVCode"),
|
sendTitle: this.$t("trials:trials-myinfo:button:getVCode"),
|
||||||
userRoleId: null,
|
userRoleId: null,
|
||||||
toggleRoleLoading: false,
|
toggleRoleLoading: false,
|
||||||
|
rules: {
|
||||||
|
CheckCode: [
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
const regex = /^[1-9]\d{5}$/;
|
||||||
|
if (
|
||||||
|
value &&
|
||||||
|
(String(value).includes('.') ||
|
||||||
|
!regex.test(String(value)))
|
||||||
|
) {
|
||||||
|
callback(new Error(this.$t('recompose:tip:inputCheckCode')))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
EMail: [
|
||||||
|
{
|
||||||
|
pattern: new RegExp(this.$reg().EmailRegexStr),
|
||||||
|
message: this.$t("passwordReset:formRule:passwordinvalid"),
|
||||||
|
trigger: ['blur'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
UserName: [
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
var lang = zzSessionStorage.getItem('lang')
|
||||||
|
? zzSessionStorage.getItem('lang')
|
||||||
|
: 'zh'
|
||||||
|
/* eslint-disable */
|
||||||
|
var reg1 = /^[a-zA-Z0-9_]{4,16}$/ //密码必须是8位以上、必须含有字母、数字、特殊符号
|
||||||
|
if (value && !reg1.test(value)) {
|
||||||
|
callback(
|
||||||
|
lang === 'zh'
|
||||||
|
? new Error(
|
||||||
|
'1)新建账号,用户名字符长度最小为4个字符,最大为16个字符,只可使用字母、数字、下划线;'
|
||||||
|
)
|
||||||
|
: new Error(
|
||||||
|
'For a new account, the username must have:1) At least 4 characters;2) At most 16 characters;3)Only letters, numbers, and underscores are allowed.'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}, trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -150,6 +199,8 @@ export default {
|
||||||
// 修改校验码
|
// 修改校验码
|
||||||
async setNewUserCheckCode() {
|
async setNewUserCheckCode() {
|
||||||
try {
|
try {
|
||||||
|
let validate = await this.$refs.userForm.validate()
|
||||||
|
if (!validate) return false
|
||||||
let res = await SetNewCheckCode(this.userForm.CheckCode);
|
let res = await SetNewCheckCode(this.userForm.CheckCode);
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.userForm.CheckCode = "";
|
this.userForm.CheckCode = "";
|
||||||
|
@ -162,7 +213,9 @@ export default {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setNewEmail() {
|
async setNewEmail() {
|
||||||
|
let validate = await this.$refs.userForm.validate()
|
||||||
|
if (!validate) return false
|
||||||
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(
|
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(
|
||||||
() => {
|
() => {
|
||||||
this.userForm.EMail = "";
|
this.userForm.EMail = "";
|
||||||
|
@ -176,6 +229,8 @@ export default {
|
||||||
},
|
},
|
||||||
async setNewUserName() {
|
async setNewUserName() {
|
||||||
try {
|
try {
|
||||||
|
let validate = await this.$refs.userForm.validate()
|
||||||
|
if (!validate) return false
|
||||||
let confirm = await this.$confirm(
|
let confirm = await this.$confirm(
|
||||||
this.$t("trials:trials-myInfo:confirmMessage:updateUserName"),
|
this.$t("trials:trials-myInfo:confirmMessage:updateUserName"),
|
||||||
{
|
{
|
||||||
|
@ -200,7 +255,9 @@ export default {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setNewPhone() {
|
async setNewPhone() {
|
||||||
|
let validate = await this.$refs.userForm.validate()
|
||||||
|
if (!validate) return false
|
||||||
setNewPhone(this.userForm.Phone).then(() => {
|
setNewPhone(this.userForm.Phone).then(() => {
|
||||||
this.userForm.Phone = "";
|
this.userForm.Phone = "";
|
||||||
this.$message.success(
|
this.$message.success(
|
||||||
|
|
Loading…
Reference in New Issue