refs select and select remote re-factoring

This commit is contained in:
Cüneyt Şentürk
2020-11-10 16:55:21 +03:00
parent 683b2a372d
commit 57759aa718
2 changed files with 254 additions and 562 deletions

View File

@ -269,7 +269,7 @@ export default {
created() { created() {
// Option set sort_option data // Option set sort_option data
if (Object.keys(this.options).length) { if (!Array.isArray(this.options)) {
for (const [key, value] of Object.entries(this.options)) { for (const [key, value] of Object.entries(this.options)) {
this.sort_options.push({ this.sort_options.push({
key: key, key: key,
@ -279,8 +279,9 @@ export default {
} else { } else {
this.options.forEach(function (option, index) { this.options.forEach(function (option, index) {
this.sort_options.push({ this.sort_options.push({
key: option, index: index,
value: index key: option.id,
value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name
}); });
}, this); }, this);
} }
@ -366,11 +367,11 @@ export default {
var value = this.$children[0].$children[0].$refs.input.value; var value = this.$children[0].$children[0].$refs.input.value;
} }
if (this.add_new.type == 'inline') { if (value === '') {
if (value === '') { return false;
return false; }
}
if (this.add_new.type == 'inline') {
await this.addInline(value); await this.addInline(value);
} else { } else {
await this.onModal(value); await this.onModal(value);
@ -535,6 +536,10 @@ export default {
padding: 10px 0 0 !important; padding: 10px 0 0 !important;
} }
.el-select-dropdown__empty.loading {
padding: 10px 0 !important;
}
.el-select__footer { .el-select__footer {
text-align: center; text-align: center;
border-top: 1px solid #dee2e6; border-top: 1px solid #dee2e6;

File diff suppressed because it is too large Load Diff