Compare commits

...

5 Commits
master ... v3.1

Author SHA1 Message Date
jiangweidong
dff6824ddc fix: 优化手机号区号更新为空及展示问题 2023-04-10 17:13:55 +08:00
feng
cbbaf7f7ca fix: 创建资产添加账号模版 2023-04-10 10:29:19 +08:00
jiangweidong
fac0d3190b perf: 手机区号增加中国台湾地区 2023-04-10 10:28:11 +08:00
jiangweidong
ec4c7a0cca feat: 手机号支持选择区号 2023-04-10 10:28:11 +08:00
Bai
351e08d542 fix: 修复 LAN 账号保存 Platform 问题 2023-03-17 15:45:08 +08:00
11 changed files with 119 additions and 3 deletions

View File

@@ -0,0 +1,80 @@
<template>
<div>
<el-input v-model="rawValue.phone" :placeholder="$tc('users.inputPhone')" @input="OnInputChange">
<el-select
slot="prepend"
:value="rawValue.code"
:placeholder="$tc('common.Select')"
style="width: 90px;"
@change="OnChange"
>
<el-option
v-for="country in countries"
:key="country.value"
:label="country.value"
:value="country.value"
style="width: 200px;"
>
<span style="float: left">{{ country.name }}</span>
<span style="float: right; font-size: 13px">{{ country.value }}</span>
</el-option>
</el-select>
</el-input>
</div>
</template>
<script>
export default {
name: 'PhoneInput',
props: {
value: {
type: [Object, String],
default: () => ({ 'code': '', 'phone': '' })
}
},
data() {
return {
rawValue: {},
countries: [
{ name: 'China(中国)', value: '+86' },
{ name: 'HongKong(中国香港)', value: '+852' },
{ name: 'Macao(中国澳门)', value: '+853' },
{ name: 'Taiwan(中国台湾)', value: '+886' },
{ name: 'America(America)', value: '+1' },
{ name: 'Russia(Россия)', value: '+7' },
{ name: 'France(français)', value: '+33' },
{ name: 'Britain(Britain)', value: '+44' },
{ name: 'Germany(Deutschland)', value: '+49' },
{ name: 'Japan(日本)', value: '+81' },
{ name: 'Korea(한국)', value: '+82' },
{ name: 'India(भारत)', value: '+91' }
]
}
},
computed: {
fullPhone() {
if (!this.rawValue.phone) {
return ''
}
return `${this.rawValue.code} ${this.rawValue.phone}`
}
},
mounted() {
this.rawValue = this.value || { code: '+86', phone: '' }
this.$emit('input', this.fullPhone)
},
methods: {
OnChange(countryCode) {
this.rawValue.code = countryCode
this.OnInputChange()
},
OnInputChange() {
this.$emit('input', this.fullPhone)
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -4,6 +4,7 @@ import Select2 from './Select2'
import TagInput from './TagInput' import TagInput from './TagInput'
import Switcher from './Switcher' import Switcher from './Switcher'
import UploadKey from './UploadKey' import UploadKey from './UploadKey'
import PhoneInput from './PhoneInput'
import JsonEditor from './JsonEditor' import JsonEditor from './JsonEditor'
import UploadField from './UploadField' import UploadField from './UploadField'
import UpdateToken from './UpdateToken' import UpdateToken from './UpdateToken'
@@ -22,6 +23,7 @@ export default {
TagInput, TagInput,
UploadKey, UploadKey,
JsonEditor, JsonEditor,
PhoneInput,
UpdateToken, UpdateToken,
UploadField, UploadField,
UserPassword, UserPassword,
@@ -40,6 +42,7 @@ export {
TagInput, TagInput,
UploadKey, UploadKey,
JsonEditor, JsonEditor,
PhoneInput,
UpdateToken, UpdateToken,
UploadField, UploadField,
UserPassword, UserPassword,

View File

@@ -1685,6 +1685,7 @@
"users": { "users": {
"Login": "Users login", "Login": "Users login",
"InviteSuccess": "Invite success", "InviteSuccess": "Invite success",
"inputPhone": "Please enter your mobile phone number",
"FileEncryptionPassword": "File encryption password", "FileEncryptionPassword": "File encryption password",
"OrgRoles": "Org roles", "OrgRoles": "Org roles",
"RoleUsers": "Role users", "RoleUsers": "Role users",

View File

@@ -1673,6 +1673,7 @@
"users": { "users": {
"Login": "ユーザー登録", "Login": "ユーザー登録",
"InviteSuccess": "成功招待", "InviteSuccess": "成功招待",
"inputPhone": "携帯電話の番号をお願いします",
"FileEncryptionPassword": "ファイル暗号化パスワード", "FileEncryptionPassword": "ファイル暗号化パスワード",
"RoleUsers": "承認されたユーザー", "RoleUsers": "承認されたユーザー",
"RoleInfo": "ロール情報", "RoleInfo": "ロール情報",

View File

@@ -1676,6 +1676,7 @@
"Login": "用户登录", "Login": "用户登录",
"InviteSuccess": "邀请成功", "InviteSuccess": "邀请成功",
"FileEncryptionPassword": "文件加密密码", "FileEncryptionPassword": "文件加密密码",
"inputPhone": "请输入手机号码",
"RoleUsers": "授权用户", "RoleUsers": "授权用户",
"RoleInfo": "角色信息", "RoleInfo": "角色信息",
"RolePerms": "角色权限", "RolePerms": "角色权限",

View File

@@ -141,6 +141,7 @@ export default {
const newAddAccounts = this.accountsSelected.filter(i => { const newAddAccounts = this.accountsSelected.filter(i => {
if (!hasIdAccounts.includes(i.id)) { if (!hasIdAccounts.includes(i.id)) {
i.template = true i.template = true
i.secret_type = i.secret_type.value
return i return i
} }
}) })

View File

@@ -79,6 +79,17 @@ export default {
}, },
password: { password: {
rules: this.$route.params.id ? [] : [RequiredChange] rules: this.$route.params.id ? [] : [RequiredChange]
},
platform: {
el: {
multiple: false,
ajax: {
url: `/api/v1/assets/platforms/`,
transformOption: (item) => {
return { label: item.name, value: item.id }
}
}
}
} }
} }
}, },

View File

@@ -5,6 +5,7 @@
<script> <script>
import { GenericCreateUpdatePage } from '@/layout/components' import { GenericCreateUpdatePage } from '@/layout/components'
import { Required } from '@/components/DataForm/rules' import { Required } from '@/components/DataForm/rules'
import { PhoneInput } from '@/components/FormFields'
export default { export default {
name: 'ProfileUpdate', name: 'ProfileUpdate',
@@ -36,6 +37,9 @@ export default {
email: { email: {
disabled: true disabled: true
}, },
phone: {
component: PhoneInput
},
mfa_level: { mfa_level: {
hidden: (formValue) => { hidden: (formValue) => {
return formValue.mfa_level === 2 return formValue.mfa_level === 2

View File

@@ -9,6 +9,7 @@
<script> <script>
import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm' import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm'
import { PhoneInput } from '@/components/FormFields'
import { IBox } from '@/components' import { IBox } from '@/components'
export default { export default {
@@ -40,6 +41,9 @@ export default {
}, },
email: { email: {
disabled: true disabled: true
},
phone: {
component: PhoneInput
} }
}, },
submitMethod() { submitMethod() {

View File

@@ -4,7 +4,7 @@
<script> <script>
import { GenericCreateUpdatePage } from '@/layout/components' import { GenericCreateUpdatePage } from '@/layout/components'
import UserPassword from '@/components/FormFields/UserPassword' import { UserPassword, PhoneInput } from '@/components/FormFields'
import rules from '@/components/DataForm/rules' import rules from '@/components/DataForm/rules'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@@ -151,6 +151,9 @@ export default {
}, },
value: [] value: []
} }
},
phone: {
component: PhoneInput
} }
}, },
submitMethod() { submitMethod() {

View File

@@ -176,8 +176,15 @@ export default {
return <img src={this.object.avatar_url} alt='' height='50'/> return <img src={this.object.avatar_url} alt='' height='50'/>
} }
}, },
'name', 'username', 'email', 'phone', 'wecom_id', 'id', 'name', 'username', 'email',
'dingtalk_id', 'feishu_id', {
key: this.$t('users.Phone'),
formatter: () => {
const phoneObj = this.object.phone
return <div>{phoneObj?.code} {phoneObj?.phone}</div>
}
},
'wecom_id', 'dingtalk_id', 'feishu_id',
{ {
key: this.$t('users.Role'), key: this.$t('users.Role'),
formatter: (item, val) => { formatter: (item, val) => {