parent
075452c698
commit
6f52bb20b0
@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<q-dialog
|
||||
ref="dialog"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
@hide="$emit('hide', $event)"
|
||||
>
|
||||
<q-card
|
||||
class="bg-main-menu q-dialog-plugin"
|
||||
>
|
||||
<q-card-section
|
||||
class="text-h6"
|
||||
>
|
||||
<q-icon
|
||||
v-if="icon !== undefined"
|
||||
:name="icon"
|
||||
size="24px"
|
||||
class="self-center"
|
||||
/>
|
||||
{{ title }}
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<slot />
|
||||
</q-card-section>
|
||||
<q-card-actions
|
||||
align="right"
|
||||
>
|
||||
<q-btn
|
||||
icon="clear"
|
||||
:label="$t('buttons.cancel')"
|
||||
flat
|
||||
@click="hide"
|
||||
/>
|
||||
<q-btn
|
||||
icon="check"
|
||||
:label="$t('buttons.confirm')"
|
||||
unelevated
|
||||
text-color="dark"
|
||||
color="primary"
|
||||
:disable="!ready"
|
||||
@click="okEvent"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'CscDialogBase',
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
icon: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
ready: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
passwordRetype: {
|
||||
password: '',
|
||||
passwordRetype: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show () {
|
||||
this.$refs.dialog.show()
|
||||
},
|
||||
hide () {
|
||||
this.$refs.dialog.hide()
|
||||
},
|
||||
okEvent ($event) {
|
||||
this.$emit('ok', $event)
|
||||
this.hide()
|
||||
},
|
||||
cancelEvent ($event) {
|
||||
this.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<csc-dialog-base
|
||||
ref="dialog"
|
||||
icon="vpn_key"
|
||||
title="Change Password"
|
||||
:ready="ready"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
@hide="$emit('hide', $event)"
|
||||
@ok="ok"
|
||||
>
|
||||
<template
|
||||
v-slot:title
|
||||
>
|
||||
Change Password
|
||||
</template>
|
||||
<csc-input-password-retype
|
||||
v-model="passwordRetype"
|
||||
dense
|
||||
@validation-failed="ready=false"
|
||||
@validation-succeeded="ready=true"
|
||||
/>
|
||||
</csc-dialog-base>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CscInputPasswordRetype from 'components/form/CscInputPasswordRetype'
|
||||
import CscDialogBase from 'components/CscDialogBase'
|
||||
export default {
|
||||
name: 'CscDialogChangePassword',
|
||||
components: {
|
||||
CscDialogBase,
|
||||
CscInputPasswordRetype
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
ready: false,
|
||||
passwordRetype: {
|
||||
password: '',
|
||||
passwordRetype: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show () {
|
||||
this.$refs.dialog.show()
|
||||
},
|
||||
hide () {
|
||||
this.$refs.dialog.hide()
|
||||
},
|
||||
ok () {
|
||||
if (this.ready) {
|
||||
this.$emit('confirmed', this.passwordRetype.password)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in new issue