diff --git a/packages/schema-page/index.vue b/packages/schema-page/index.vue
index 7f7cdb8..dcaeeca 100644
--- a/packages/schema-page/index.vue
+++ b/packages/schema-page/index.vue
@@ -10,7 +10,7 @@
- $emit('update:value-filter', e)" :loading="loading" @search="onSearch">
+ $emit('update:value-filter', e)" :loading="tableLoading" @search="onSearch">
@@ -26,7 +26,13 @@
-
+
@@ -165,7 +171,7 @@ setKeysDefault(['value-table'], {
},
});
setKeysDefault(['size', 'dialogTitle', 'dialogType'], String);
-setKeysDefault(['dialogVisible', 'auto'], Boolean);
+setKeysDefault(['dialogVisible', 'auto', 'loading'], Boolean);
setKeysDefault(['api-search', 'api-submit', 'api-new', 'api-edit', 'api-get', 'api-detail', 'api-delete'], Function);
export default {
@@ -198,7 +204,7 @@ export default {
detailSchema: filterout(cloneDeep(this.schema.form || {}), ['is', 'rules']),
detail: this.valueDetail || {},
tableData: this.valueTable || [],
- loading: false,
+ tableLoading: this.loading || false,
submitting: false,
dialogLoading: false,
};
@@ -239,6 +245,9 @@ export default {
tableData(val) {
this.$emit('update:value-table', val);
},
+ tableLoading(val) {
+ this.$emit('update:loading', val);
+ },
},
computed: {
slotKeys() {
@@ -248,10 +257,11 @@ export default {
return this.size || get(this.schema, 'props.size') || (this.$ELEMENT || {}).size;
},
_slotScope() {
- const properties = ['selection', 'currentPage', 'pageSizes', 'pageSize', 'layout', 'total', 'loading'];
+ const properties = ['selection', 'currentPage', 'pageSizes', 'pageSize', 'layout', 'total'];
const methods = ['search', 'onSearch', 'onDelete', 'onDeleteMultiple', 'openNew', 'openEdit', 'openDetail', 'openDialog', 'closeDialog'];
const defaultScope = {
size: this._size,
+ loading: this.tableLoading,
};
return [...properties, ...methods].reduce((result, current) => {
result[current] = this[current];
@@ -327,8 +337,8 @@ export default {
},
// 查询
search() {
- if (!this.loading) {
- this.loading = true;
+ if (!this.tableLoading) {
+ this.tableLoading = true;
const params = {
...this.valueFilter,
currentPage: this.currentPage,
@@ -342,7 +352,7 @@ export default {
this.total = response[1] || 0;
})
.finally(() => {
- this.loading = false;
+ this.tableLoading = false;
});
}
},
diff --git a/packages/schema-select/index.vue b/packages/schema-select/index.vue
index ec4e711..c9f3a46 100644
--- a/packages/schema-select/index.vue
+++ b/packages/schema-select/index.vue
@@ -12,7 +12,7 @@
-
+
$emit('update:value-filter', e)"
:schema="selectSchema"
:size="selectSize"
@@ -80,6 +81,9 @@ export default {
const props = context.props || {};
const keyword = props.keyword;
const value = props.value || '';
+ if (!keyword) {
+ return h('span', value);
+ }
const reg = new RegExp(`(${keyword})`, 'g');
const result = `${value}`.replace(reg, '$1');
return h('span', { domProps: { innerHTML: result } });
@@ -149,7 +153,9 @@ export default {
visible: false,
inputHovering: false,
tableData: [],
+ loading: false,
loaded: false,
+ inFocus: false,
};
},
created() {
@@ -283,16 +289,22 @@ export default {
}
},
onInputFocus() {
+ this.visible = true;
+ this.inFocus = true;
if (!this.allowCreate) {
this.model = '';
}
},
onInputBlur() {
+ this.inFocus = false;
if (!this.visible) {
this.model = this.selectedLabel;
}
},
onClickoutside() {
+ if (!this.inFocus) {
+ this.visible = false;
+ }
if (this.visible) {
this.model = this.selectedLabel;
this.query = '';
@@ -311,7 +323,6 @@ export default {
event.stopPropagation();
this.query = '';
this.model = '';
- this.visible = false;
this.$emit('input', '');
this.$emit('clear');
this.$emit('change', '');
--
libgit2 0.21.0