76 lines
1.6 KiB
Vue
76 lines
1.6 KiB
Vue
<template>
|
|
<div class="content-search">
|
|
<BasicSearch
|
|
ref="basicSearchRef"
|
|
:searchList="searchList"
|
|
:initial-values="initSearchData"
|
|
@reset="handleReset"
|
|
@finish="onSearchFinish"
|
|
@values-change="onValuesChange"
|
|
>
|
|
<template #actions>
|
|
<a-tooltip title="新增配置">
|
|
<a-button @click="props.handleAdd" type="primary"> 新增沿程配置 </a-button>
|
|
</a-tooltip>
|
|
</template>
|
|
</BasicSearch>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref, computed, onMounted } from "vue";
|
|
import BasicSearch from "@/components/BasicSearch/index.vue";
|
|
|
|
interface Props {
|
|
handleAdd: () => void;
|
|
}
|
|
|
|
const props = defineProps<Props>();
|
|
|
|
const emit = defineEmits<{
|
|
(e: "reset", values: any): void;
|
|
(e: "searchFinish", values: any): void;
|
|
}>();
|
|
|
|
const initSearchData = {
|
|
configName: "",
|
|
};
|
|
|
|
const searchData = ref<any>({ ...initSearchData });
|
|
const searchList: any = computed(() => [
|
|
{
|
|
type: "Input",
|
|
name: "name",
|
|
label: "沿程配置名称",
|
|
fieldProps: {
|
|
allowClear: true,
|
|
},
|
|
},
|
|
{
|
|
type: "Input",
|
|
name: "rvnm",
|
|
label: "所在河段",
|
|
fieldProps: {
|
|
allowClear: true,
|
|
},
|
|
},
|
|
]);
|
|
|
|
const onSearchFinish = (values: any) => {
|
|
emit("searchFinish", values);
|
|
};
|
|
|
|
const onValuesChange = (changedValues: any, allValues: any) => {
|
|
searchData.value = { ...searchData.value, ...allValues };
|
|
};
|
|
|
|
const handleReset = () => {
|
|
emit("reset", initSearchData);
|
|
};
|
|
|
|
onMounted(() => {
|
|
emit("searchFinish", initSearchData);
|
|
});
|
|
</script>
|
|
<style lang="scss"></style>
|