akaunting 3.0 (the last dance)
This commit is contained in:
50
resources/assets/js/views/settings/categories.js
vendored
50
resources/assets/js/views/settings/categories.js
vendored
@ -15,50 +15,46 @@ import Global from './../../mixins/global';
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
|
||||
import {ColorPicker} from 'element-ui';
|
||||
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin, ColorPicker);
|
||||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
Global,
|
||||
],
|
||||
|
||||
components: {
|
||||
[ColorPicker.name]: ColorPicker,
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.color = this.form.color;
|
||||
},
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('category'),
|
||||
bulk_action: new BulkAction('categories'),
|
||||
color: '#55588b',
|
||||
predefineColors: [
|
||||
'#3c3f72',
|
||||
'#55588b',
|
||||
'#e5e5e5',
|
||||
'#328aef',
|
||||
'#efad32',
|
||||
'#ef3232',
|
||||
'#efef32'
|
||||
]
|
||||
categoriesBasedTypes: null,
|
||||
isParentCategoryDisabled: true,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChangeColor() {
|
||||
this.form.color = this.color;
|
||||
},
|
||||
updateParentCategories(event) {
|
||||
if (event === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
onChangeColorInput() {
|
||||
this.color = this.form.color;
|
||||
if (typeof JSON.parse(this.form.categories)[event] === 'undefined') {
|
||||
this.categoriesBasedTypes = [];
|
||||
this.isParentCategoryDisabled = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.form.parent_category_id) {
|
||||
this.form.parent_category_id = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.categoriesBasedTypes = JSON.parse(this.form.categories)[event];
|
||||
this.isParentCategoryDisabled = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user