Akaunting Select Remote fixed remote method issue..
This commit is contained in:
parent
8d9ed87f20
commit
7ac53681ff
@ -64,7 +64,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-option v-if="!group" v-for="(option, index) in sortOptions"
|
<el-option v-if="!group" v-for="(option, index) in sortOptions"
|
||||||
:key="index"
|
:key="option.key"
|
||||||
:disabled="disabledOptions.includes(option.key)"
|
:disabled="disabledOptions.includes(option.key)"
|
||||||
:label="option.value"
|
:label="option.value"
|
||||||
:value="option.key">
|
:value="option.key">
|
||||||
@ -79,7 +79,7 @@
|
|||||||
:label="group_options.key">
|
:label="group_options.key">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(option, option_index) in group_options.value"
|
v-for="(option, option_index) in group_options.value"
|
||||||
:key="option_index"
|
:key="option.key"
|
||||||
:disabled="disabledOptions.includes(option.key)"
|
:disabled="disabledOptions.includes(option.key)"
|
||||||
:label="option.value"
|
:label="option.value"
|
||||||
:value="option.key">
|
:value="option.key">
|
||||||
@ -165,7 +165,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-option v-if="!group" v-for="(option, index) in sortOptions"
|
<el-option v-if="!group" v-for="(option, index) in sortOptions"
|
||||||
:key="index"
|
:key="option.key"
|
||||||
:disabled="disabledOptions.includes(option.key)"
|
:disabled="disabledOptions.includes(option.key)"
|
||||||
:label="option.value"
|
:label="option.value"
|
||||||
:value="option.key">
|
:value="option.key">
|
||||||
@ -180,7 +180,7 @@
|
|||||||
:label="group_options.key">
|
:label="group_options.key">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(option, option_index) in group_options.value"
|
v-for="(option, option_index) in group_options.value"
|
||||||
:key="option_index"
|
:key="option.key"
|
||||||
:disabled="disabledOptions.includes(option.key)"
|
:disabled="disabledOptions.includes(option.key)"
|
||||||
:label="option.value"
|
:label="option.value"
|
||||||
:value="option.key">
|
:value="option.key">
|
||||||
@ -671,15 +671,31 @@ export default {
|
|||||||
|
|
||||||
if (response.data.data) {
|
if (response.data.data) {
|
||||||
let data = response.data.data;
|
let data = response.data.data;
|
||||||
|
//this.sort_options = [];
|
||||||
this.sort_options = [];
|
|
||||||
|
|
||||||
data.forEach(function (option) {
|
data.forEach(function (option) {
|
||||||
|
let check = false;
|
||||||
|
|
||||||
|
this.sort_options.forEach(function (sort_option) {
|
||||||
|
if (sort_option.key == option.id) {
|
||||||
|
check = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!check) {
|
||||||
this.sort_options.push({
|
this.sort_options.push({
|
||||||
key: option.id.toString(),
|
key: option.id.toString(),
|
||||||
value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name
|
value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
this.sort_options = this.sort_options.filter(item => {
|
||||||
|
return item.value.toLowerCase()
|
||||||
|
.indexOf(query.toLowerCase()) > -1;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.sortOptions = [];
|
this.sortOptions = [];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user