Explorar o código

update Web/src/components/table/search.vue.
增加搜索框的重置事件(可自定重置事件)

Signed-off-by: inypeacock <1300856@qq.com>

inypeacock %!s(int64=3) %!d(string=hai) anos
pai
achega
8ccbe5dd5b
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      Web/src/components/table/search.vue

+ 6 - 1
Web/src/components/table/search.vue

@@ -72,6 +72,10 @@ const props = defineProps({
 		type: Array<TableSearchType>,
 		default: () => [],
 	},
+	reset: {
+		type: Object,
+		default: () => {},
+	},
 	param: {
 		type: Object,
 		default: () => {},
@@ -79,7 +83,7 @@ const props = defineProps({
 });
 
 // 定义子组件向父组件传值/事件
-const emit = defineEmits(['search']);
+const emit = defineEmits(['search', 'reset']);
 
 // 定义变量内容
 const tableSearchRef = ref<FormInstance>();
@@ -115,6 +119,7 @@ const onSearch = (formEl: FormInstance | undefined) => {
 const onReset = (formEl: FormInstance | undefined) => {
 	if (!formEl) return;
 	formEl.resetFields();
+    emit('reset', state.form);
 	emit('search', state.form);
 };
 // 初始化 form 字段,取自父组件 search.prop