Browse Source

查询弹窗组件修改查询条件方式为筛选

master
陈薪名 11 months ago
parent
commit
3c7a2dd84b
  1. 38
      src/components/SearchTable/src/SearchTable.vue

38
src/components/SearchTable/src/SearchTable.vue

@ -1,7 +1,16 @@
<template>
<Dialog :title="dialogTitle" v-model="searchDialogVisible" :width="'80%'">
<!-- 搜索工作栏 -->
<Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" />
<!-- <Search :schema="searchSchema" @search="setSearchParamsRef" @reset="setSearchParamsRef" /> -->
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
:routeName="routeName"
@searchFormClick="searchFormClick"
:allSchemas="allSchemasRef"
/>
<ContentWrap>
<Table
ref="searchTableRef"
:columns="tableColumns"
@ -15,6 +24,7 @@
v-model:sort="tableObjectRef.sort"
:selection="true"
/>
</ContentWrap>
<template #footer>
<div class="flex items-center">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
@ -24,14 +34,26 @@
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// const { t } = useI18n() //
const message = useMessage() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const searchDialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
//
const HeadButttondata = [
defaultButtons.defaultFilterBtn(null), //
]
/** 打开弹窗 */
const getListRef = ref()
const setSearchParamsRef = ref()
const tableObjectRef = ref()
const getPage:any = ref()
@ -41,12 +63,14 @@ const formFieldRef = ref()
const searchFieldRef = ref()
const typeRef = ref()
const rowRef = ref()
const allSchemasRef = ref()
const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, searchField: any, type: any, row: any ) => {
searchDialogVisible.value = true
formFieldRef.value = formField
searchFieldRef.value = searchField
allSchemasRef.value = allSchemas
searchSchema.value = allSchemas.searchSchema
tableColumns.value = allSchemas.tableColumns
tableColumns.value = allSchemas.tableColumns.filter(item => (item.field !== 'action'))
getPage.value = getApiPage
typeRef.value = type
rowRef.value = row
@ -59,9 +83,19 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
//
const { getList, setSearchParams } = tableMethods
setSearchParamsRef.value = setSearchParams
getListRef.value = getList
getList()
}
//
const searchFormClick = (searchData) => {
tableObjectRef.value.params = {
isSearch: true,
filters: searchData.filters
}
getListRef.value() //
}
defineExpose({ open }) // open
// Table ref

Loading…
Cancel
Save