Add form for creating new tag

This commit is contained in:
Angelina Filippova 2020-09-05 21:34:00 +03:00
parent 2d70096f51
commit e3d5d5b625
2 changed files with 21 additions and 2 deletions

View file

@ -187,6 +187,7 @@ export default {
search: 'Search', search: 'Search',
id: 'ID', id: 'ID',
name: 'Name', name: 'Name',
label: 'Label',
status: 'Status', status: 'Status',
local: 'Local', local: 'Local',
external: 'External', external: 'External',

View file

@ -120,7 +120,18 @@
:show-close="false" :show-close="false"
:title="$t('users.createCustomTag')" :title="$t('users.createCustomTag')"
@open="resetForm"> @open="resetForm">
<span/> <el-form ref="customTagForm" :model="customTagForm" :label-width="isDesktop ? '120px' : '85px'">
<el-form-item :label="$t('users.name')" prop="name">
<el-input v-model="customTagForm.name" name="name" autofocus/>
</el-form-item>
<el-form-item :label="$t('users.label')" prop="label">
<el-input v-model="customTagForm.label" name="label"/>
</el-form-item>
<span slot="footer">
<el-button @click="closeCustomTagDialog">{{ $t('users.cancel') }}</el-button>
<el-button type="primary" @click="addCustomTag('customTagForm')">{{ $t('users.create') }}</el-button>
</span>
</el-form>
</el-dialog> </el-dialog>
<div v-if="!loading" class="pagination"> <div v-if="!loading" class="pagination">
<el-pagination <el-pagination
@ -166,7 +177,11 @@ export default {
selectedUsers: [], selectedUsers: [],
createAccountDialogOpen: false, createAccountDialogOpen: false,
resetPasswordDialogOpen: false, resetPasswordDialogOpen: false,
createCustomTagDialogOpen: false createCustomTagDialogOpen: false,
customTagForm: {
name: '',
label: ''
}
} }
}, },
computed: { computed: {
@ -218,6 +233,9 @@ export default {
clearSelection() { clearSelection() {
this.$refs.usersTable.clearSelection() this.$refs.usersTable.clearSelection()
}, },
closeCustomTagDialog() {
this.createCustomTagDialogOpen = false
},
closeResetPasswordDialog() { closeResetPasswordDialog() {
this.resetPasswordDialogOpen = false this.resetPasswordDialogOpen = false
this.$store.dispatch('RemovePasswordToken') this.$store.dispatch('RemovePasswordToken')