mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-17 07:42:41 +00:00
fix: 修改通用创建更新成功后的Route; 优化用户ACL创建ip_group错误时的信息显示
This commit is contained in:
@@ -176,7 +176,9 @@ export default {
|
|||||||
type: Function,
|
type: Function,
|
||||||
default(res, method, vm, addContinue) {
|
default(res, method, vm, addContinue) {
|
||||||
const route = this.getNextRoute(res, method)
|
const route = this.getNextRoute(res, method)
|
||||||
|
if (!(route.params && route.params.id)) {
|
||||||
route['params'] = { 'id': res.id }
|
route['params'] = { 'id': res.id }
|
||||||
|
}
|
||||||
this.$emit('submitSuccess', res)
|
this.$emit('submitSuccess', res)
|
||||||
|
|
||||||
this.emitPerformSuccessMsg(method, res, addContinue)
|
this.emitPerformSuccessMsg(method, res, addContinue)
|
||||||
|
@@ -1,16 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm
|
<GenericCreateUpdateForm v-bind="$data" />
|
||||||
:fields="fields"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:initial="object"
|
|
||||||
:url="url"
|
|
||||||
:update-success-next-route="updateSuccessNextRoute"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
:get-method="getMethod"
|
|
||||||
:on-perform-success="onPerformSuccess"
|
|
||||||
:perform-submit="performSubmit"
|
|
||||||
/>
|
|
||||||
</IBox>
|
</IBox>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -82,12 +72,6 @@ export default {
|
|||||||
delete value['mfa_level']
|
delete value['mfa_level']
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMethod() {
|
|
||||||
return 'put'
|
|
||||||
},
|
},
|
||||||
performSubmit(validValues) {
|
performSubmit(validValues) {
|
||||||
if (!validValues.terms) {
|
if (!validValues.terms) {
|
||||||
@@ -99,8 +83,14 @@ export default {
|
|||||||
onPerformSuccess() {
|
onPerformSuccess() {
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
setTimeout(() => this.$router.push({ name: 'UserGuide' }), 100)
|
setTimeout(() => this.$router.push({ name: 'UserGuide' }), 100)
|
||||||
|
},
|
||||||
|
getMethod() {
|
||||||
|
return 'put'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage v-bind="$data" :clean-form-value="cleanFormValue" />
|
<GenericCreateUpdatePage v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -92,10 +92,7 @@ export default {
|
|||||||
{ validator: validatorInterval }
|
{ validator: validatorInterval }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
cleanFormValue(data) {
|
cleanFormValue(data) {
|
||||||
if (data['password_strategy'] === 'custom') {
|
if (data['password_strategy'] === 'custom') {
|
||||||
delete data['password_rules']
|
delete data['password_rules']
|
||||||
@@ -106,7 +103,10 @@ export default {
|
|||||||
delete data['interval']
|
delete data['interval']
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
generatePasswordRulesItemsFields() {
|
generatePasswordRulesItemsFields() {
|
||||||
const itemsFields = []
|
const itemsFields = []
|
||||||
const items = [
|
const items = [
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" :clean-form-value="cleanFormValue" :after-get-form-value="afterGetFormValue" />
|
<GenericCreateUpdatePage v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -60,10 +59,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: '/api/v1/acls/login-asset-acls/'
|
url: '/api/v1/acls/login-asset-acls/',
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
afterGetFormValue(formValue) {
|
afterGetFormValue(formValue) {
|
||||||
formValue.assets.ip_group = formValue.assets.ip_group.toString()
|
formValue.assets.ip_group = formValue.assets.ip_group.toString()
|
||||||
formValue.assets.hostname_group = formValue.assets.hostname_group.toString()
|
formValue.assets.hostname_group = formValue.assets.hostname_group.toString()
|
||||||
@@ -95,6 +91,9 @@ export default {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage
|
<GenericCreateUpdatePage v-bind="$data" />
|
||||||
v-bind="$data"
|
|
||||||
:after-get-form-value="afterGetFormValue"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -47,10 +43,24 @@ export default {
|
|||||||
}},
|
}},
|
||||||
createSuccessNextRoute: { name: 'UserDetail', params: {
|
createSuccessNextRoute: { name: 'UserDetail', params: {
|
||||||
id: this.$route.query.user
|
id: this.$route.query.user
|
||||||
}}
|
}},
|
||||||
|
onPerformError(error, method, vm) {
|
||||||
|
this.$emit('submitError', error)
|
||||||
|
const response = error.response
|
||||||
|
const data = response.data
|
||||||
|
if (response.status === 400) {
|
||||||
|
for (const key of Object.keys(data)) {
|
||||||
|
let value = data[key]
|
||||||
|
if (key === 'ip_group') {
|
||||||
|
value = Object.values(data[key])
|
||||||
|
}
|
||||||
|
if (value instanceof Array) {
|
||||||
|
value = value.join(';')
|
||||||
|
}
|
||||||
|
this.$refs.form.setFieldError(key, value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
afterGetFormValue(validValues) {
|
afterGetFormValue(validValues) {
|
||||||
validValues.ip_group = validValues.ip_group.toString()
|
validValues.ip_group = validValues.ip_group.toString()
|
||||||
return validValues
|
return validValues
|
||||||
@@ -59,9 +69,13 @@ export default {
|
|||||||
if (!Array.isArray(value.ip_group)) {
|
if (!Array.isArray(value.ip_group)) {
|
||||||
value.ip_group = value.ip_group ? value.ip_group.split(',') : []
|
value.ip_group = value.ip_group ? value.ip_group.split(',') : []
|
||||||
}
|
}
|
||||||
|
console.log('>>>>>>>>: ', value)
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -66,7 +66,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,13 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage
|
<GenericCreateUpdatePage v-bind="$data" />
|
||||||
:fields="fields"
|
|
||||||
:has-detail-in-msg="false"
|
|
||||||
:initial="initial"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:url="url"
|
|
||||||
:get-next-route="getNextRoute"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -86,10 +78,8 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: `/api/v1/assets/gateways/`
|
url: `/api/v1/assets/gateways/`,
|
||||||
}
|
hasDetailInMsg: false,
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getNextRoute(res, method) {
|
getNextRoute(res, method) {
|
||||||
const domain = res.domain
|
const domain = res.domain
|
||||||
const route = {
|
const route = {
|
||||||
@@ -110,6 +100,9 @@ export default {
|
|||||||
return values
|
return values
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -3,9 +3,6 @@
|
|||||||
v-bind="$data"
|
v-bind="$data"
|
||||||
:create-success-next-route="successUrl"
|
:create-success-next-route="successUrl"
|
||||||
:update-success-next-route="successUrl"
|
:update-success-next-route="successUrl"
|
||||||
:has-detail-in-msg="false"
|
|
||||||
:after-get-form-value="afterGetFormValue"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -55,12 +52,8 @@ export default {
|
|||||||
}
|
}
|
||||||
return `${url}?type=${commandType}`
|
return `${url}?type=${commandType}`
|
||||||
},
|
},
|
||||||
url: '/api/v1/terminal/command-storages/'
|
url: '/api/v1/terminal/command-storages/',
|
||||||
}
|
hasDetailInMsg: false,
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
afterGetFormValue(validValues) {
|
afterGetFormValue(validValues) {
|
||||||
if (!validValues?.meta?.HOSTS) {
|
if (!validValues?.meta?.HOSTS) {
|
||||||
return validValues
|
return validValues
|
||||||
@@ -73,6 +66,11 @@ export default {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,14 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm
|
<GenericCreateUpdateForm v-bind="$data" />
|
||||||
:fields="fields"
|
|
||||||
:url="url"
|
|
||||||
:get-method="getMethod"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:more-buttons="moreButtons"
|
|
||||||
:has-detail-in-msg="false"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
/>
|
|
||||||
</IBox>
|
</IBox>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -51,10 +43,8 @@ export default {
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
hasDetailInMsg: false,
|
||||||
getMethod() {
|
getMethod() {
|
||||||
return 'put'
|
return 'put'
|
||||||
},
|
},
|
||||||
@@ -66,6 +56,9 @@ export default {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,14 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm
|
<GenericCreateUpdateForm v-bind="$data" />
|
||||||
:fields="fields"
|
|
||||||
:url="url"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
:get-method="getMethod"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:more-buttons="moreButtons"
|
|
||||||
:has-detail-in-msg="false"
|
|
||||||
/>
|
|
||||||
</IBox>
|
</IBox>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,6 +64,7 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
hasDetailInMsg: false,
|
||||||
url: '/api/v1/settings/setting/?category=email',
|
url: '/api/v1/settings/setting/?category=email',
|
||||||
moreButtons: [
|
moreButtons: [
|
||||||
{
|
{
|
||||||
@@ -87,13 +80,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMethod() {
|
|
||||||
return 'put'
|
|
||||||
},
|
|
||||||
cleanFormValue(data) {
|
cleanFormValue(data) {
|
||||||
if (!data['EMAIL_HOST_PASSWORD']) {
|
if (!data['EMAIL_HOST_PASSWORD']) {
|
||||||
delete data['EMAIL_HOST_PASSWORD']
|
delete data['EMAIL_HOST_PASSWORD']
|
||||||
@@ -106,8 +93,14 @@ export default {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
return data
|
return data
|
||||||
|
},
|
||||||
|
getMethod() {
|
||||||
|
return 'put'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -1,15 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm
|
<GenericCreateUpdateForm v-bind="$data" />
|
||||||
:fields="selectFields"
|
|
||||||
:url="url"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:get-method="getMethod"
|
|
||||||
:more-buttons="moreButtons"
|
|
||||||
:has-detail-in-msg="false"
|
|
||||||
:after-get-form-value="changeFormValue"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
/>
|
|
||||||
<ImportDialog :visible.sync="dialogLdapUserImport" />
|
<ImportDialog :visible.sync="dialogLdapUserImport" />
|
||||||
<TestLoginDialog :visible.sync="dialogTest" />
|
<TestLoginDialog :visible.sync="dialogTest" />
|
||||||
</IBox>
|
</IBox>
|
||||||
@@ -67,6 +58,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: '/api/v1/settings/setting/?category=ldap',
|
url: '/api/v1/settings/setting/?category=ldap',
|
||||||
|
hasDetailInMsg: false,
|
||||||
moreButtons: [
|
moreButtons: [
|
||||||
{
|
{
|
||||||
title: this.$t('setting.ldapConnectTest'),
|
title: this.$t('setting.ldapConnectTest'),
|
||||||
@@ -94,17 +86,11 @@ export default {
|
|||||||
this.dialogLdapUserImport = true
|
this.dialogLdapUserImport = true
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMethod() {
|
getMethod() {
|
||||||
return 'put'
|
return 'put'
|
||||||
},
|
},
|
||||||
changeFormValue(obj) {
|
afterGetFormValue(obj) {
|
||||||
obj.AUTH_LDAP_USER_ATTR_MAP = JSON.stringify(obj.AUTH_LDAP_USER_ATTR_MAP)
|
obj.AUTH_LDAP_USER_ATTR_MAP = JSON.stringify(obj.AUTH_LDAP_USER_ATTR_MAP)
|
||||||
return obj
|
return obj
|
||||||
},
|
},
|
||||||
@@ -118,6 +104,12 @@ export default {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,13 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm
|
<GenericCreateUpdateForm v-bind="$data" />
|
||||||
:fields="selectFields"
|
|
||||||
:url="url"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:get-method="getMethod"
|
|
||||||
:has-detail-in-msg="false"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
/>
|
|
||||||
</IBox>
|
</IBox>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -41,20 +34,8 @@ export default {
|
|||||||
type: 'input'
|
type: 'input'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: '/api/v1/settings/setting/?category=terminal'
|
url: '/api/v1/settings/setting/?category=terminal',
|
||||||
}
|
hasDetailInMsg: false,
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.$store.getters.hasValidLicense) {
|
|
||||||
const xRDPFields = [
|
|
||||||
'XRDP', [
|
|
||||||
'TERMINAL_RDP_ADDR'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
this.selectFields.splice(1, 0, xRDPFields)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMethod() {
|
getMethod() {
|
||||||
return 'put'
|
return 'put'
|
||||||
},
|
},
|
||||||
@@ -69,6 +50,19 @@ export default {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.$store.getters.hasValidLicense) {
|
||||||
|
const xRDPFields = [
|
||||||
|
'XRDP', [
|
||||||
|
'TERMINAL_RDP_ADDR'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
this.selectFields.splice(1, 0, xRDPFields)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,14 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm
|
<GenericCreateUpdateForm v-bind="$data" />
|
||||||
:fields="fields"
|
|
||||||
:url="url"
|
|
||||||
:get-method="getMethod"
|
|
||||||
:fields-meta="fieldsMeta"
|
|
||||||
:more-buttons="moreButtons"
|
|
||||||
:has-detail-in-msg="false"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
/>
|
|
||||||
</IBox>
|
</IBox>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -26,6 +18,7 @@ export default {
|
|||||||
const vm = this
|
const vm = this
|
||||||
return {
|
return {
|
||||||
url: '/api/v1/settings/setting/?category=wecom',
|
url: '/api/v1/settings/setting/?category=wecom',
|
||||||
|
hasDetailInMsg: false,
|
||||||
moreButtons: [
|
moreButtons: [
|
||||||
{
|
{
|
||||||
title: this.$t('setting.weComTest'),
|
title: this.$t('setting.weComTest'),
|
||||||
@@ -51,12 +44,6 @@ export default {
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getMethod() {
|
|
||||||
return 'put'
|
|
||||||
},
|
},
|
||||||
// 不清理的话,编辑secret,在删除提交会报错
|
// 不清理的话,编辑secret,在删除提交会报错
|
||||||
cleanFormValue(data) {
|
cleanFormValue(data) {
|
||||||
@@ -64,8 +51,14 @@ export default {
|
|||||||
delete data['WECOM_SECRET']
|
delete data['WECOM_SECRET']
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
},
|
||||||
|
getMethod() {
|
||||||
|
return 'put'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage
|
<GenericCreateUpdatePage v-bind="$data" @getObjectDone="afterGetUser" />
|
||||||
v-bind="$data"
|
|
||||||
:clean-form-value="cleanFormValue"
|
|
||||||
@getObjectDone="afterGetUser"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -134,18 +130,15 @@ export default {
|
|||||||
value: []
|
value: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
getMethod() {
|
||||||
|
const params = this.$route.params
|
||||||
|
if (params.id) {
|
||||||
|
return 'put'
|
||||||
|
} else {
|
||||||
|
return 'post'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
...mapGetters(['currentOrgIsRoot'])
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.currentOrgIsRoot) {
|
|
||||||
this.fieldsMeta.groups.el.disabled = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
const method = this.getMethod()
|
const method = this.getMethod()
|
||||||
if (method === 'post' && value.password_strategy === 'email') {
|
if (method === 'post' && value.password_strategy === 'email') {
|
||||||
@@ -158,15 +151,18 @@ export default {
|
|||||||
delete value.update_password
|
delete value.update_password
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
},
|
}
|
||||||
getMethod() {
|
|
||||||
const params = this.$route.params
|
|
||||||
if (params.id) {
|
|
||||||
return 'put'
|
|
||||||
} else {
|
|
||||||
return 'post'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['currentOrgIsRoot'])
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.currentOrgIsRoot) {
|
||||||
|
this.fieldsMeta.groups.el.disabled = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
afterGetUser(user) {
|
afterGetUser(user) {
|
||||||
this.user = user
|
this.user = user
|
||||||
if (this.$route.query.clone_from) {
|
if (this.$route.query.clone_from) {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<GenericCreateUpdatePage ref="createUpdatePage" v-bind="$data" :clean-form-value="cleanFormValue" :after-get-form-value="afterGetFormValue" />
|
<GenericCreateUpdatePage ref="createUpdatePage" v-bind="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -116,18 +116,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateSuccessNextRoute: { name: 'CloudCenter' },
|
updateSuccessNextRoute: { name: 'CloudCenter' },
|
||||||
createSuccessNextRoute: { name: 'CloudCenter' }
|
createSuccessNextRoute: { name: 'CloudCenter' },
|
||||||
}
|
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
const params = this.$route.params
|
|
||||||
// 更新获取链接
|
|
||||||
if (params.id) {
|
|
||||||
const form = await this.$refs.createUpdatePage.$refs.createUpdateForm.getFormValue()
|
|
||||||
this.fieldsMeta.regions.el.ajax.url = form.account ? `/api/v1/xpack/cloud/regions/?account_id=${form.account}` : `/api/v1/xpack/cloud/regions/`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
afterGetFormValue(formValue) {
|
afterGetFormValue(formValue) {
|
||||||
formValue.ip_network_segment_group = formValue.ip_network_segment_group.toString()
|
formValue.ip_network_segment_group = formValue.ip_network_segment_group.toString()
|
||||||
return formValue
|
return formValue
|
||||||
@@ -139,6 +128,17 @@ export default {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
const params = this.$route.params
|
||||||
|
// 更新获取链接
|
||||||
|
if (params.id) {
|
||||||
|
const form = await this.$refs.createUpdatePage.$refs.createUpdateForm.getFormValue()
|
||||||
|
this.fieldsMeta.regions.el.ajax.url = form.account ? `/api/v1/xpack/cloud/regions/?account_id=${form.account}` : `/api/v1/xpack/cloud/regions/`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user