|
@@ -53,7 +53,10 @@ const searchFormProps = reactive<VxeFormProps<TagQuery>>({
|
|
|
options: [
|
|
options: [
|
|
|
{ label: '系统', value: '1' },
|
|
{ label: '系统', value: '1' },
|
|
|
{ label: '个人', value: '2' },
|
|
{ label: '个人', value: '2' },
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ events: {
|
|
|
|
|
+ change(value: { data: TagQuery }) { onSearch(value.data) },
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -68,14 +71,18 @@ const searchFormProps = reactive<VxeFormProps<TagQuery>>({
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
const searchFormEmits: VxeFormListeners<TagQuery> = {
|
|
const searchFormEmits: VxeFormListeners<TagQuery> = {
|
|
|
- submit({ data }) {
|
|
|
|
|
- /* 修正 types 全空无效 */
|
|
|
|
|
- if (!data.types?.length) data.types = ['1', '2']
|
|
|
|
|
- model.value = { ...data };
|
|
|
|
|
- },
|
|
|
|
|
- reset({ data }) { model.value = { ...data, }; },
|
|
|
|
|
|
|
+ submit({ data }) { onSearch(data); },
|
|
|
|
|
+ reset({ data }) { onSearch(data) },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+function onSearch(data: TagQuery) {
|
|
|
|
|
+ const types: TagQuery['types'] = data.types?.length ? data.types : ['1', '2'];
|
|
|
|
|
+ model.value = { ...data, types: [...types] };
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ searchFormProps.data!.types = [...types];
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const gridRef = ref<VxeGridInstance<TagModel>>();
|
|
const gridRef = ref<VxeGridInstance<TagModel>>();
|
|
|
const gridOptions = reactive<VxeGridProps<TagModel>>({
|
|
const gridOptions = reactive<VxeGridProps<TagModel>>({
|
|
|
id: 'tag-list',
|
|
id: 'tag-list',
|