[Update] 修改button透传

This commit is contained in:
ibuler
2020-05-06 19:20:09 +08:00
parent e0063f5cd2
commit add0d34338
13 changed files with 118 additions and 98 deletions

View File

@@ -1,6 +1,12 @@
<template> <template>
<DataForm ref="dataForm" v-loading="loading" :fields="totalFields" v-bind="$attrs" v-on="$listeners"> <DataForm ref="dataForm" v-loading="loading" :fields="totalFields" v-bind="$attrs" v-on="$listeners">
<FormGroupHeader v-for="(group, i) in groups" :slot="'id:'+group.name" :key="'group-'+group.name" :title="group.title" :line="i != 0" /> <FormGroupHeader v-for="(group, i) in groups" :slot="'id:'+group.name" :key="'group-'+group.name" :title="group.title" :line="i != 0" />
<template #button-start>
<slot name="button-start" />
</template>
<template #button-end>
<slot name="button-end" />
</template>
</DataForm> </DataForm>
</template> </template>

View File

@@ -572,8 +572,7 @@ const cn = {
'securityPasswordLowerCase': '必须包含小写字母', 'securityPasswordLowerCase': '必须包含小写字母',
'securityPasswordNumber': '必须包含数字字符', 'securityPasswordNumber': '必须包含数字字符',
'securityPasswordSpecialChar': '必须包含特殊字符', 'securityPasswordSpecialChar': '必须包含特殊字符',
'Hostname': '主机名' 'Hostname': '主机名',
},
helpText: { helpText: {
'siteUrl': 'eg: http://jumpserver.abc.com:8080', 'siteUrl': 'eg: http://jumpserver.abc.com:8080',
'userGuideUrl': '用户第一次登录修改profile后重定向到地址', 'userGuideUrl': '用户第一次登录修改profile后重定向到地址',
@@ -605,6 +604,7 @@ const cn = {
'securityPasswordLowerCase': '开启后,用户密码修改、重置必须包含小写字母', 'securityPasswordLowerCase': '开启后,用户密码修改、重置必须包含小写字母',
'securityPasswordNumber': '开启后,用户密码修改、重置必须包含数字字符', 'securityPasswordNumber': '开启后,用户密码修改、重置必须包含数字字符',
'securityPasswordSpecialChar': '开启后,用户密码修改、重置必须包含特殊字符' 'securityPasswordSpecialChar': '开启后,用户密码修改、重置必须包含特殊字符'
}
}, },
...zhLocale ...zhLocale
} }

View File

@@ -384,8 +384,7 @@ const en = {
'securityPasswordLowerCase': 'Must contain lowercase letters', 'securityPasswordLowerCase': 'Must contain lowercase letters',
'securityPasswordNumber': 'Must contain numeric characters', 'securityPasswordNumber': 'Must contain numeric characters',
'securityPasswordSpecialChar': 'Must contain special characters', 'securityPasswordSpecialChar': 'Must contain special characters',
'Hostname': 'Hostname' 'Hostname': 'Hostname',
},
helpText: { helpText: {
'siteUrl': 'eg: http://jumpserver.abc.com:8080', 'siteUrl': 'eg: http://jumpserver.abc.com:8080',
'userGuideUrl': 'User first login update profile done redirect to it', 'userGuideUrl': 'User first login update profile done redirect to it',
@@ -419,6 +418,7 @@ const en = {
'securityPasswordLowerCase': '开启后,用户密码修改、重置必须包含小写字母', 'securityPasswordLowerCase': '开启后,用户密码修改、重置必须包含小写字母',
'securityPasswordNumber': '开启后,用户密码修改、重置必须包含数字字符', 'securityPasswordNumber': '开启后,用户密码修改、重置必须包含数字字符',
'securityPasswordSpecialChar': '开启后,用户密码修改、重置必须包含特殊字符' 'securityPasswordSpecialChar': '开启后,用户密码修改、重置必须包含特殊字符'
}
}, },
...enLocale ...enLocale
} }

View File

@@ -9,7 +9,14 @@
v-bind="$attrs" v-bind="$attrs"
v-on="$listeners" v-on="$listeners"
@submit="handleSubmit" @submit="handleSubmit"
/> >
<template #button-start>
<slot name="button-start" />
</template>
<template #button-end>
<slot name="button-end" />
</template>
</AutoDataForm>
</template> </template>
<script> <script>
import AutoDataForm from '@/components/AutoDataForm' import AutoDataForm from '@/components/AutoDataForm'

View File

@@ -1,7 +1,14 @@
<template> <template>
<Page> <Page>
<IBox> <IBox>
<GenericCreateUpdateForm v-bind="$attrs" v-on="$listeners" /> <GenericCreateUpdateForm v-bind="$attrs" v-on="$listeners">
<template #button-start>
<slot name="button-start" />
</template>
<template #button-end>
<slot name="button-end" />
</template>
</GenericCreateUpdateForm>
</IBox> </IBox>
</Page> </Page>
</template> </template>

View File

@@ -17,7 +17,7 @@ export default {
columns: [ columns: [
{ {
prop: 'name', prop: 'name',
label: this.$t('common.name'), label: this.$t('common.Name'),
formatter: DetailFormatter, formatter: DetailFormatter,
sortable: true, sortable: true,
route: 'AdminUserDetail' route: 'AdminUserDetail'

View File

@@ -17,7 +17,7 @@ export default {
columns: [ columns: [
{ {
prop: 'name', prop: 'name',
label: this.$t('common.name'), label: this.$t('common.Name'),
formatter: DetailFormatter, formatter: DetailFormatter,
sortable: true, sortable: true,
route: 'SystemUserDetail' route: 'SystemUserDetail'

View File

@@ -37,18 +37,18 @@ export default {
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.siteUrl') helpText: this.$t('setting.helpText.siteUrl')
}, },
USER_GUIDE_URL: { USER_GUIDE_URL: {
label: this.$t('setting.userGuideUrl'), label: this.$t('setting.userGuideUrl'),
helpText: this.$t('helpText.userGuideUrl') helpText: this.$t('setting.helpText.userGuideUrl')
}, },
EMAIL_SUBJECT_PREFIX: { EMAIL_SUBJECT_PREFIX: {
label: this.$t('setting.emailSubjectPrefix'), label: this.$t('setting.emailSubjectPrefix'),
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.emailSubjectPrefix') helpText: this.$t('setting.helpText.emailSubjectPrefix')
} }
}, },
url: '/api/v1/settings/setting/' url: '/api/v1/settings/setting/'

View File

@@ -51,25 +51,25 @@ export default {
}, },
EMAIL_HOST_PASSWORD: { EMAIL_HOST_PASSWORD: {
label: this.$t('setting.emailHostPassword'), label: this.$t('setting.emailHostPassword'),
helpText: this.$t('helpText.emailHostPassword') helpText: this.$t('setting.helpText.emailHostPassword')
}, },
EMAIL_FROM: { EMAIL_FROM: {
label: this.$t('setting.emailEmailFrom'), label: this.$t('setting.emailEmailFrom'),
helpText: this.$t('helpText.emailEmailFrom') helpText: this.$t('setting.helpText.emailEmailFrom')
}, },
EMAIL_RECIPIENT: { EMAIL_RECIPIENT: {
label: this.$t('setting.emailRecipient'), label: this.$t('setting.emailRecipient'),
helpText: this.$t('helpText.emailRecipient') helpText: this.$t('setting.helpText.emailRecipient')
}, },
EMAIL_USE_SSL: { EMAIL_USE_SSL: {
label: this.$t('setting.emailUserSSL'), label: this.$t('setting.emailUserSSL'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.emailUserSSL') helpTips: this.$t('setting.helpTip.emailUserSSL')
}, },
EMAIL_USE_TLS: { EMAIL_USE_TLS: {
label: this.$t('setting.emailUserTLS'), label: this.$t('setting.emailUserTLS'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.emailUserTLS') helpTips: this.$t('setting.helpTip.emailUserTLS')
} }
}, },
url: '/api/v1/settings/setting/' url: '/api/v1/settings/setting/'

View File

@@ -35,22 +35,22 @@ export default {
fieldsMeta: { fieldsMeta: {
EMAIL_CUSTOM_USER_CREATED_SUBJECT: { EMAIL_CUSTOM_USER_CREATED_SUBJECT: {
label: this.$t('setting.emailCustomUserCreatedSubject'), label: this.$t('setting.emailCustomUserCreatedSubject'),
helpText: this.$t('helpText.emailCustomUserCreatedSubject') helpText: this.$t('setting.helpText.emailCustomUserCreatedSubject')
}, },
EMAIL_CUSTOM_USER_CREATED_HONORIFIC: { EMAIL_CUSTOM_USER_CREATED_HONORIFIC: {
label: this.$t('setting.emailCustomUserCreatedHonorific'), label: this.$t('setting.emailCustomUserCreatedHonorific'),
helpText: this.$t('helpText.emailCustomUserCreatedHonorific') helpText: this.$t('setting.helpText.emailCustomUserCreatedHonorific')
}, },
EMAIL_CUSTOM_USER_CREATED_BODY: { EMAIL_CUSTOM_USER_CREATED_BODY: {
label: this.$t('setting.emailCustomUserCreatedBody'), label: this.$t('setting.emailCustomUserCreatedBody'),
el: { el: {
type: 'textarea' type: 'textarea'
}, },
helpText: this.$t('helpText.emailCustomUserCreatedBody') helpText: this.$t('setting.helpText.emailCustomUserCreatedBody')
}, },
EMAIL_CUSTOM_USER_CREATED_SIGNATURE: { EMAIL_CUSTOM_USER_CREATED_SIGNATURE: {
label: this.$t('setting.emailCustomUserCreatedSignature'), label: this.$t('setting.emailCustomUserCreatedSignature'),
helpText: this.$t('helpText.emailCustomUserCreatedSignature') helpText: this.$t('setting.helpText.emailCustomUserCreatedSignature')
} }
}, },
url: '/api/v1/settings/setting/' url: '/api/v1/settings/setting/'

View File

@@ -44,14 +44,14 @@ export default {
}, },
AUTH_LDAP_SEARCH_OU: { AUTH_LDAP_SEARCH_OU: {
label: this.$t('setting.authLdapSearchOu'), label: this.$t('setting.authLdapSearchOu'),
helpText: this.$t('helpText.authLdapSearchOu') helpText: this.$t('setting.helpText.authLdapSearchOu')
}, },
AUTH_LDAP_SEARCH_FILTER: { AUTH_LDAP_SEARCH_FILTER: {
label: this.$t('setting.authLdapSearchFilter'), label: this.$t('setting.authLdapSearchFilter'),
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.authLdapSearchFilter') helpText: this.$t('setting.helpText.authLdapSearchFilter')
}, },
AUTH_LDAP_USER_ATTR_MAP: { AUTH_LDAP_USER_ATTR_MAP: {
label: this.$t('setting.authLdapUserAttrMap'), label: this.$t('setting.authLdapUserAttrMap'),
@@ -61,7 +61,7 @@ export default {
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.authLdapUserAttrMap') helpText: this.$t('setting.helpText.authLdapUserAttrMap')
}, },
AUTH_LDAP: { AUTH_LDAP: {
label: this.$t('setting.authLdap'), label: this.$t('setting.authLdap'),

View File

@@ -38,17 +38,17 @@ export default {
SECURITY_MFA_AUTH: { SECURITY_MFA_AUTH: {
label: this.$t('setting.securityMfaAuth'), label: this.$t('setting.securityMfaAuth'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityMfaAuth') helpTips: this.$t('setting.helpTip.securityMfaAuth')
}, },
SECURITY_COMMAND_EXECUTION: { SECURITY_COMMAND_EXECUTION: {
label: this.$t('setting.securityCommandExecution'), label: this.$t('setting.securityCommandExecution'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityCommandExecution') helpTips: this.$t('setting.helpTip.securityCommandExecution')
}, },
SECURITY_SERVICE_ACCOUNT_REGISTRATION: { SECURITY_SERVICE_ACCOUNT_REGISTRATION: {
label: this.$t('setting.securityServiceAccountRegistration'), label: this.$t('setting.securityServiceAccountRegistration'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityServiceAccountRegistration') helpTips: this.$t('setting.helpTip.securityServiceAccountRegistration')
}, },
SECURITY_LOGIN_LIMIT_COUNT: { SECURITY_LOGIN_LIMIT_COUNT: {
label: this.$t('setting.securityLoginLimitCount'), label: this.$t('setting.securityLoginLimitCount'),
@@ -61,18 +61,18 @@ export default {
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.securityLoginLimitTime') helpText: this.$t('setting.helpText.securityLoginLimitTime')
}, },
SECURITY_MAX_IDLE_TIME: { SECURITY_MAX_IDLE_TIME: {
label: this.$t('setting.securityMaxIdleTime'), label: this.$t('setting.securityMaxIdleTime'),
helpText: this.$t('helpText.securityMaxIdleTime') helpText: this.$t('setting.helpText.securityMaxIdleTime')
}, },
SECURITY_PASSWORD_EXPIRATION_TIME: { SECURITY_PASSWORD_EXPIRATION_TIME: {
label: this.$t('setting.securityPasswordExpirationTime'), label: this.$t('setting.securityPasswordExpirationTime'),
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.securityPasswordExpirationTime') helpText: this.$t('setting.helpText.securityPasswordExpirationTime')
}, },
SECURITY_PASSWORD_MIN_LENGTH: { SECURITY_PASSWORD_MIN_LENGTH: {
label: this.$t('setting.securityPasswordMinLength'), label: this.$t('setting.securityPasswordMinLength'),
@@ -83,22 +83,22 @@ export default {
SECURITY_PASSWORD_UPPER_CASE: { SECURITY_PASSWORD_UPPER_CASE: {
label: this.$t('setting.securityPasswordUpperCase'), label: this.$t('setting.securityPasswordUpperCase'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityPasswordUpperCase') helpTips: this.$t('setting.helpTip.securityPasswordUpperCase')
}, },
SECURITY_PASSWORD_LOWER_CASE: { SECURITY_PASSWORD_LOWER_CASE: {
label: this.$t('setting.securityPasswordLowerCase'), label: this.$t('setting.securityPasswordLowerCase'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityPasswordLowerCase') helpTips: this.$t('setting.helpTip.securityPasswordLowerCase')
}, },
SECURITY_PASSWORD_NUMBER: { SECURITY_PASSWORD_NUMBER: {
label: this.$t('setting.securityPasswordNumber'), label: this.$t('setting.securityPasswordNumber'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityPasswordNumber') helpTips: this.$t('setting.helpTip.securityPasswordNumber')
}, },
SECURITY_PASSWORD_SPECIAL_CHAR: { SECURITY_PASSWORD_SPECIAL_CHAR: {
label: this.$t('setting.securityPasswordSpecialChar'), label: this.$t('setting.securityPasswordSpecialChar'),
type: 'checkbox', type: 'checkbox',
helpTips: this.$t('helpTip.securityPasswordSpecialChar') helpTips: this.$t('setting.helpTip.securityPasswordSpecialChar')
} }
}, },
url: '/api/v1/settings/setting/' url: '/api/v1/settings/setting/'

View File

@@ -46,7 +46,7 @@ export default {
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.terminalHeartbeatInterval') helpText: this.$t('setting.helpText.terminalHeartbeatInterval')
}, },
TERMINAL_ASSET_LIST_SORT_BY: { TERMINAL_ASSET_LIST_SORT_BY: {
label: this.$t('setting.terminalAssetListSortBy'), label: this.$t('setting.terminalAssetListSortBy'),
@@ -84,11 +84,11 @@ export default {
rules: [ rules: [
{ required: true } { required: true }
], ],
helpText: this.$t('helpText.terminalSessionKeepDuration') helpText: this.$t('setting.helpText.terminalSessionKeepDuration')
}, },
TERMINAL_TELNET_REGEX: { TERMINAL_TELNET_REGEX: {
label: this.$t('setting.terminalTelnetRegex'), label: this.$t('setting.terminalTelnetRegex'),
helpText: this.$t('helpText.terminalTelnetRegex') helpText: this.$t('setting.helpText.terminalTelnetRegex')
} }
}, },
url: '/api/v1/settings/setting/' url: '/api/v1/settings/setting/'