Index page path changes..
This commit is contained in:
@ -1,131 +1,175 @@
|
||||
<template>
|
||||
|
||||
<base-input :label="title"
|
||||
:name="name"
|
||||
:class="formClasses"
|
||||
:error="formError">
|
||||
<el-select
|
||||
:class="'pl-20 mr-40'"
|
||||
v-model="real_model"
|
||||
@input="change"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
:placeholder="placeholder"
|
||||
:remote-method="remoteMethod"
|
||||
:loading="loading">
|
||||
<div v-if="loading" class="el-select-dropdown__wrap" slot="empty">
|
||||
<p class="el-select-dropdown__empty loading">
|
||||
{{ loadingText }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<el-select @input="change" filterable :placeholder="placeholder">
|
||||
<div v-else-if="options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
||||
<p class="el-select-dropdown__empty">
|
||||
{{ noMatchingDataText }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<template slot="prefix">
|
||||
<span class="el-input__suffix-inner el-select-icon">
|
||||
<i :class="'select-icon-position el-input__icon fa fa-' + icon"></i>
|
||||
</span>
|
||||
</template>
|
||||
<div v-else-if="options.length == 0" slot="empty">
|
||||
<p class="el-select-dropdown__empty">
|
||||
{{ noDataText }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<el-option v-if="!group" v-for="(label, value) in selectOptions"
|
||||
<template v-if="icon" slot="prefix">
|
||||
<span class="el-input__suffix-inner el-select-icon">
|
||||
<i :class="'select-icon-position el-input__icon fa fa-' + icon"></i>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<el-option v-if="!group" v-for="option in selectOptions"
|
||||
:key="option.id"
|
||||
:label="option.name"
|
||||
:value="option.id">
|
||||
</el-option>
|
||||
|
||||
<el-option-group
|
||||
v-if="group"
|
||||
v-for="(options, name) in selectOptions"
|
||||
:key="name"
|
||||
:label="name">
|
||||
<el-option
|
||||
v-for="(label, value) in options"
|
||||
:key="value"
|
||||
:label="label"
|
||||
:value="value">
|
||||
</el-option>
|
||||
|
||||
<el-option-group
|
||||
v-if="group"
|
||||
v-for="(options, name) in selectOptions"
|
||||
:key="name"
|
||||
:label="name">
|
||||
<el-option
|
||||
v-for="(label, value) in options"
|
||||
:key="value"
|
||||
:label="label"
|
||||
:value="value">
|
||||
</el-option>
|
||||
</el-option-group>
|
||||
|
||||
</el-select>
|
||||
|
||||
</base-input>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.el-select {
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { Select, Option, OptionGroup } from 'element-ui';
|
||||
import { Select, Option, OptionGroup } from 'element-ui';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
[Select.name]: Select,
|
||||
[Option.name]: Option,
|
||||
[OptionGroup.name]: OptionGroup,
|
||||
},
|
||||
export default {
|
||||
name: 'akaunting-select',
|
||||
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
description: "Modal header title"
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '',
|
||||
description: "Modal header title"
|
||||
},
|
||||
formClasses: null,
|
||||
formError: null,
|
||||
name: null,
|
||||
value: null,
|
||||
options: null,
|
||||
model: null,
|
||||
icon: {
|
||||
type: String,
|
||||
description: "Prepend icon (left)"
|
||||
components: {
|
||||
[Select.name]: Select,
|
||||
[Option.name]: Option,
|
||||
[OptionGroup.name]: OptionGroup,
|
||||
},
|
||||
|
||||
group: false,
|
||||
multiple:false,
|
||||
disabled:false,
|
||||
collapse: false
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
isOpen: false,
|
||||
selectOptions: this.options,
|
||||
real_model: this.model,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
toggleDropDown() {
|
||||
this.isOpen = !this.isOpen;
|
||||
this.$emit("change", this.isOpen);
|
||||
},
|
||||
closeDropDown() {
|
||||
this.isOpen = false;
|
||||
this.$emit("change", this.isOpen);
|
||||
}
|
||||
},
|
||||
|
||||
directives: {
|
||||
'click-outside': {
|
||||
bind: function(el, binding, vNode) {
|
||||
// Provided expression must evaluate to a function.
|
||||
if (typeof binding.value !== 'function') {
|
||||
const compName = vNode.context.name
|
||||
let warn = `[Vue-click-outside:] provided expression '${binding.expression}' is not a function, but has to be`
|
||||
if (compName) { warn += `Found in component '${compName}'` }
|
||||
|
||||
console.warn(warn)
|
||||
}
|
||||
// Define Handler and cache it on the element
|
||||
const bubble = binding.modifiers.bubble
|
||||
const handler = (e) => {
|
||||
if (bubble || (!el.contains(e.target) && el !== e.target)) {
|
||||
binding.value(e)
|
||||
}
|
||||
}
|
||||
el.__vueClickOutside__ = handler
|
||||
|
||||
// add Event Listeners
|
||||
document.addEventListener('click', handler)
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
default: null,
|
||||
description: "Selectbox attribute name"
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '',
|
||||
description: "Selectbox input placeholder text"
|
||||
},
|
||||
options: null,
|
||||
value: {
|
||||
type: String,
|
||||
default: null,
|
||||
description: "Selectbox selected value"
|
||||
},
|
||||
|
||||
unbind: function(el, binding) {
|
||||
// Remove Event Listeners
|
||||
document.removeEventListener('click', el.__vueClickOutside__)
|
||||
el.__vueClickOutside__ = null
|
||||
icon: {
|
||||
type: String,
|
||||
description: "Prepend icon (left)"
|
||||
},
|
||||
|
||||
group: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
description: "Selectbox option group status"
|
||||
},
|
||||
|
||||
loadingText: {
|
||||
type: String,
|
||||
default: 'Loading...',
|
||||
description: "Selectbox loading message"
|
||||
},
|
||||
noDataText: {
|
||||
type: String,
|
||||
default: 'No Data',
|
||||
description: "Selectbox empty options message"
|
||||
},
|
||||
noMatchingDataText: {
|
||||
type: String,
|
||||
default: 'No Matchign Data',
|
||||
description: "Selectbox search option not found item message"
|
||||
},
|
||||
|
||||
remoteAction: {
|
||||
type: String,
|
||||
default: null,
|
||||
description: "Selectbox remote action path"
|
||||
},
|
||||
remoteType: {
|
||||
type: String,
|
||||
default: 'invoice',
|
||||
description: "Ger remote item type."
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
selectOptions: this.options,
|
||||
real_model: this.model,
|
||||
loading: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.real_model = this.value;
|
||||
|
||||
this.$emit('interface', this.real_model);
|
||||
},
|
||||
|
||||
methods: {
|
||||
change() {
|
||||
this.$emit('change', this.real_model);
|
||||
this.$emit('interface', this.real_model);
|
||||
|
||||
this.selectOptions.forEach(item => {
|
||||
if (item.id == this.real_model) {
|
||||
this.$emit('label', item.name);
|
||||
this.$emit('option', item);
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
remoteMethod() {
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
options: function (options) {
|
||||
// update options
|
||||
//this.selectOptions = options;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
4
resources/assets/js/plugins/bulk-action.js
vendored
4
resources/assets/js/plugins/bulk-action.js
vendored
@ -74,7 +74,7 @@ export default class BulkAction {
|
||||
this.loading = true;
|
||||
|
||||
if (this.value != 'export') {
|
||||
axios.post(url +'/common/bulk-actions/' + path, {
|
||||
axios.post(path, {
|
||||
'handle': this.value,
|
||||
'selected': this.selected
|
||||
})
|
||||
@ -97,7 +97,7 @@ export default class BulkAction {
|
||||
});
|
||||
} else {
|
||||
axios({
|
||||
url: url +'/common/bulk-actions/' + path,
|
||||
url: path,
|
||||
method: 'POST',
|
||||
data:{
|
||||
'handle': this.value,
|
||||
|
Reference in New Issue
Block a user