WholeProcessPlatform/frontend/src/views/shuJuTianBao/approvalLogSearch.vue
2026-04-24 17:46:41 +08:00

67 lines
1.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="approval-log-search">
<BasicSearch ref="basicSearchRef" :searchList="searchList" :initial-values="initSearchData"
@finish="onSearchFinish" @values-change="onValuesChange" @reset="handleReset">
</BasicSearch>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, onMounted } from "vue";
import BasicSearch from "@/components/BasicSearch/index.vue";
// --- Props & Emits ---
interface Props {
actionTypeDict: any[];
}
const props = defineProps<Props>();
const emit = defineEmits<{
(e: "reset", values: any): void;
(e: "searchFinish", values: any): void;
}>();
// 模拟 initSearchData
const initSearchData = {
action: '',
};
const searchData = ref<any>({ ...initSearchData });
const searchList: any = computed(() => [
{
type: "Select",
name: "action",
label: "操作类型",
fieldProps: {
allowClear: true,
},
options: props.actionTypeDict || [],
},
]);
// --- Methods ---
// 2. 搜索表单逻辑
const onSearchFinish = (values: any) => {
console.log(values);
emit("searchFinish", values);
};
const handleReset = () => {
emit("reset", initSearchData);
};
const onValuesChange = (changedValues: any, allValues: any) => {
// 同步更新本地 searchData以便其他逻辑使用
searchData.value = { ...searchData.value, ...allValues };
};
// --- Lifecycle ---
onMounted(() => {
emit("searchFinish", initSearchData);
});
</script>
<style lang="scss"></style>