Browse Source

[Fix][UI Next][V1.0.0-Alpha] Fix the user token edit bug. (#9123)

* [Fix][UI Next][V1.0.0-Alpha] Fix the user token edit bug.
3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
ddfd4a5762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      dolphinscheduler-ui-next/src/views/security/token-manage/components/token-modal.tsx

14
dolphinscheduler-ui-next/src/views/security/token-manage/components/token-modal.tsx

@ -67,6 +67,10 @@ const TokenModal = defineComponent({
: '' : ''
variables.model.expireTime = Date.now() variables.model.expireTime = Date.now()
variables.model.token = '' variables.model.token = ''
} else {
variables.model.userId = props.row.userId
variables.model.expireTime = new Date(props.row.expireTime).getTime()
variables.model.token = props.row.token
} }
ctx.emit('cancelModal', props.showModalRef) ctx.emit('cancelModal', props.showModalRef)
} }
@ -75,6 +79,12 @@ const TokenModal = defineComponent({
handleValidate(props.statusRef) handleValidate(props.statusRef)
} }
const changeUser = () => {
if (props.statusRef !== 0) {
variables.model.token = ''
}
}
watch( watch(
() => props.showModalRef, () => props.showModalRef,
() => { () => {
@ -119,11 +129,12 @@ const TokenModal = defineComponent({
cancelModal, cancelModal,
confirmModal, confirmModal,
getToken, getToken,
changeUser,
userStore userStore
} }
}, },
render() { render() {
const { t, getToken, userStore } = this const { t, getToken, changeUser, userStore } = this
return ( return (
<div> <div>
@ -171,6 +182,7 @@ const TokenModal = defineComponent({
placeholder={t('security.token.user_tips')} placeholder={t('security.token.user_tips')}
options={this.model.generalOptions} options={this.model.generalOptions}
v-model={[this.model.userId, 'value']} v-model={[this.model.userId, 'value']}
onUpdateValue={changeUser}
/> />
</NFormItem> </NFormItem>
)} )}

Loading…
Cancel
Save