akaunting 3.0 (the last dance)
This commit is contained in:
@ -5,15 +5,14 @@
|
||||
@cancel="onCancel"
|
||||
v-if="display">
|
||||
<template #modal-body>
|
||||
<div class="modal-body text-left">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="py-1 px-5 bg-body">
|
||||
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
|
||||
<div class="form-group sm:col-span-3">
|
||||
<base-input
|
||||
required
|
||||
class="required"
|
||||
v-model="form.name"
|
||||
:label="text.name"
|
||||
prepend-icon="fas fa-font"
|
||||
:placeholder="placeholder.name"
|
||||
:error="form.errors.name[0]"
|
||||
@input="form.errors.name[0] = ''"
|
||||
@ -21,59 +20,44 @@
|
||||
</base-input>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group sm:col-span-3">
|
||||
<base-input
|
||||
required
|
||||
class="required"
|
||||
:error="form.errors.class[0]"
|
||||
:label="text.type">
|
||||
<span class="el-input__prefix">
|
||||
<span class="el-input__suffix-inner el-select-icon">
|
||||
<i class="select-icon-position el-input__icon fa fa-bars"></i>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<el-select
|
||||
class="select-primary"
|
||||
@change="form.errors.class[0] = ''"
|
||||
v-model="form.class" filterable
|
||||
:placeholder="placeholder.type">
|
||||
<el-option v-for="(name, value) in types"
|
||||
class="select-primary"
|
||||
:key="name"
|
||||
:label="name"
|
||||
:value="value">
|
||||
:key="name"
|
||||
:label="name"
|
||||
:value="value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</base-input>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<base-input
|
||||
:label="text.width">
|
||||
<span class="el-input__prefix">
|
||||
<span class="el-input__suffix-inner el-select-icon">
|
||||
<i class="select-icon-position el-input__icon fas fa-ruler-horizontal"></i>
|
||||
</span>
|
||||
</span>
|
||||
<div class="form-group sm:col-span-3">
|
||||
<base-input :label="text.width">
|
||||
<el-select
|
||||
class="select-primary"
|
||||
v-model="form.width" filterable
|
||||
:placeholder="placeholder.width">
|
||||
<el-option v-for="option in widthOptions"
|
||||
class="select-primary"
|
||||
:key="option.label"
|
||||
:label="option.label"
|
||||
:value="option.value">
|
||||
:key="option.label"
|
||||
:label="option.label"
|
||||
:value="option.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</base-input>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group sm:col-span-3">
|
||||
<base-input
|
||||
v-model="form.sort"
|
||||
:label="text.sort"
|
||||
prepend-icon="fas fa-sort"
|
||||
:placeholder="placeholder.sort"
|
||||
:error="form.errors.sort[0]"
|
||||
@input="form.errors.sort[0] = ''"
|
||||
@ -84,33 +68,20 @@
|
||||
</template>
|
||||
|
||||
<template #card-footer>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-icon btn-outline-secondary" @click="onCancel">
|
||||
{{ text.cancel }}
|
||||
</button>
|
||||
<div class="flex items-center justify-end">
|
||||
<button type="button" class="flex items-center justify-center px-6 py-1.5 text-base rounded-lg mr-2 bg-transparent hover:bg-gray-300 disabled:bg-gray-200" @click="onCancel">
|
||||
{{ text.cancel }}
|
||||
</button>
|
||||
|
||||
<button :disabled="form.loading" type="button" class="btn btn-icon btn-success button-submit" @click="onSave">
|
||||
<span v-if="form.loading" class="btn-inner--icon"><i class="aka-loader"></i></span>
|
||||
<span :class="[{'ml-0': form.loading}]" class="btn-inner--text">{{ text.save }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button :disabled="form.loading" type="button" class="relative flex items-center justify-center bg-green hover:bg-green-700 text-white px-6 py-1.5 text-base rounded-lg disabled:bg-green-100" @click="onSave">
|
||||
<i v-if="form.loading" class="animate-submit delay-[0.28s] absolute w-2 h-2 rounded-full left-0 right-0 -top-3.5 m-auto before:absolute before:w-2 before:h-2 before:rounded-full before:animate-submit before:delay-[0.14s] after:absolute after:w-2 after:h-2 after:rounded-full after:animate-submit before:-left-3.5 after:-right-3.5 after:delay-[0.42s]"></i>
|
||||
<span :class="[{'opacity-0': form.loading}]">{{ text.save }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</akaunting-modal>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.el-input__prefix
|
||||
{
|
||||
left: 20px;
|
||||
z-index: 999;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import { Select, Option } from 'element-ui';
|
||||
@ -197,19 +168,19 @@ export default {
|
||||
widthOptions: [
|
||||
{
|
||||
label: '25%',
|
||||
value: 'col-md-3'
|
||||
value: 'w-full lg:w-1/4 px-6'
|
||||
},
|
||||
{
|
||||
label: '33%',
|
||||
value: 'col-md-4'
|
||||
value: 'w-full lg:w-1/3 px-6'
|
||||
},
|
||||
{
|
||||
label: '50%',
|
||||
value: 'col-md-6'
|
||||
value: 'w-full lg:w-2/4 px-12'
|
||||
},
|
||||
{
|
||||
label: '100%',
|
||||
value: 'col-md-12'
|
||||
value: 'w-full px-12'
|
||||
}
|
||||
],
|
||||
form: {
|
||||
@ -282,7 +253,7 @@ export default {
|
||||
onCancel() {
|
||||
let documentClasses = document.body.classList;
|
||||
|
||||
documentClasses.remove("modal-open");
|
||||
documentClasses.remove("overflow-hidden");
|
||||
|
||||
this.display = false;
|
||||
this.form.name = '';
|
||||
@ -301,9 +272,9 @@ export default {
|
||||
let documentClasses = document.body.classList;
|
||||
|
||||
if (val) {
|
||||
documentClasses.add("modal-open");
|
||||
documentClasses.add("overflow-hidden");
|
||||
} else {
|
||||
documentClasses.remove("modal-open");
|
||||
documentClasses.remove("overflow-hidden");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user