perf: 用户手机添加默认值及账号模版详情切换至显示

This commit is contained in:
feng
2023-06-09 18:31:54 +08:00
parent 7aa8afec44
commit 21373574de
5 changed files with 23 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ export default {
props: {
value: {
type: [Object, String],
default: () => ({ 'code': '', 'phone': '' })
default: () => ({ 'code': '+86', 'phone': '' })
}
},
data() {

View File

@@ -1,6 +1,7 @@
{
"": "",
"accounts": {
"SuFrom": "Su from",
"GenerateSuccessMsg": "Accounts generated successfully",
"GenerateAccounts": "Regenerate accounts",
"AccountTemplateUpdateSecretHelpText": "The account list displays accounts created through templates. When updating ciphertext, the ciphertext of the account created through the template will be updated.",
@@ -2174,4 +2175,4 @@
"PublishStatus": "Publish status",
"NoPublished": "Unpublished"
}
}
}

View File

@@ -2,6 +2,7 @@
"": "",
"accounts": {
"Accounts": "アカウント",
"SuFrom": "から",
"AccountTemplateUpdateSecretHelpText": "アカウントリストには、テンプレートで作成されたアカウントが表示されます。暗号文を更新すると、テンプレートで作成されたアカウントの暗号文が更新されます。",
"SelectAccount": "アカウントを選択",
"GenerateSuccessMsg": "アカウントの生成に成功しました",
@@ -2166,4 +2167,4 @@
"PublishStatus": "投稿ステータス",
"NoPublished": "未発表"
}
}
}

View File

@@ -2,6 +2,7 @@
"": "",
"accounts": {
"Accounts": "账号",
"SuFrom": "切换至",
"SelectAccount": "选择账号",
"AccountTemplateUpdateSecretHelpText": "账号列表展示通过模版创建的账号。更新密文时,会更新通过模版所创建账号的密文。",
"GenerateSuccessMsg": "账号生成成功",

View File

@@ -1,7 +1,7 @@
<template>
<el-row :gutter="20">
<el-col :md="14" :sm="24">
<AutoDetailCard :url="url" :object="object" :excludes="excludes" />
<AutoDetailCard :url="url" :object="object" :fields="detailFields" />
</el-col>
<el-col :md="10" :sm="24">
<QuickActions type="primary" :actions="quickActions" />
@@ -22,7 +22,8 @@ export default {
props: {
object: {
type: Object,
default: () => {}
default: () => {
}
}
},
data() {
@@ -50,11 +51,22 @@ export default {
}
],
url: `/api/v1/accounts/account-templates/${this.object.id}/`,
excludes: ['privileged', 'secret', 'passphrase', 'spec_info']
excludes: ['privileged', 'secret', 'passphrase', 'spec_info'],
detailFields: [
'id', 'name', 'username', 'secret_type', 'created_by', 'comment',
{
key: this.$t('accounts.SuFrom'),
formatter: () => {
const su_from = this.object.su_from
if (!su_from) return <span>-</span>
return <span>{su_from.name}({su_from.username})</span>
}
},
'is_active', 'date_created', 'date_updated'
]
}
},
computed: {
}
computed: {}
}
</script>