【更新】所有列表上面重置按钮重置后刷新列表

pull/90/head
小诺 2023-03-12 14:55:37 +08:00 committed by 俞宝山
parent 3ed834204b
commit b546184f3f
20 changed files with 122 additions and 38 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<a-card :bordered="false" :body-style="{ 'padding-bottom': '0px' }" class="mb-2"> <a-card :bordered="false" :body-style="{ 'padding-bottom': '0px' }" class="mb-2">
<a-form ref="formRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form"> <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="8"> <a-col :span="8">
<a-form-item label="关键字" name="searchKey"> <a-form-item label="关键字" name="searchKey">
@ -15,7 +15,7 @@
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-button type="primary" @click="table.refresh(true)"></a-button> <a-button type="primary" @click="table.refresh(true)"></a-button>
<a-button style="margin: 0 8px" @click="() => formRef.resetFields()">重置</a-button> <a-button style="margin: 0 8px" @click="reset"></a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -46,7 +46,7 @@
import thirdApi from '@/api/auth/thirdApi' import thirdApi from '@/api/auth/thirdApi'
import tool from '@/utils/tool' import tool from '@/utils/tool'
let searchFormState = reactive({}) let searchFormState = reactive({})
const formRef = ref() const searchFormRef = ref()
const table = ref() const table = ref()
const toolConfig = { refresh: true, height: true, columnSetting: false, striped: false } const toolConfig = { refresh: true, height: true, columnSetting: false, striped: false }
const columns = [ const columns = [
@ -87,6 +87,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const categoryOptions = tool.dictList('THIRD_CATEGORY') const categoryOptions = tool.dictList('THIRD_CATEGORY')
</script> </script>

View File

@ -27,7 +27,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -83,7 +83,7 @@
</template> </template>
<script setup name="bizOrg"> <script setup name="bizOrg">
import { message, Empty } from 'ant-design-vue' import { Empty } from 'ant-design-vue'
import bizOrgApi from '@/api/biz/bizOrgApi' import bizOrgApi from '@/api/biz/bizOrgApi'
import Form from './form.vue' import Form from './form.vue'
@ -143,6 +143,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const loadTreeData = () => { const loadTreeData = () => {
bizOrgApi bizOrgApi

View File

@ -27,7 +27,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -83,7 +83,7 @@
</template> </template>
<script setup name="bizPosition"> <script setup name="bizPosition">
import { message, Empty } from 'ant-design-vue' import { Empty } from 'ant-design-vue'
import bizPositionApi from '@/api/biz/bizPositionApi' import bizPositionApi from '@/api/biz/bizPositionApi'
import bizOrgApi from '@/api/biz/bizOrgApi' import bizOrgApi from '@/api/biz/bizOrgApi'
import Form from './form.vue' import Form from './form.vue'
@ -143,6 +143,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
bizOrgApi bizOrgApi
.orgTree() .orgTree()

View File

@ -39,7 +39,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
{{ $t('common.searchButton') }} {{ $t('common.searchButton') }}
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
{{ $t('common.resetButton') }} {{ $t('common.resetButton') }}
</a-button> </a-button>
@ -227,6 +227,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
bizUserApi bizUserApi
.userOrgTreeSelector() .userOrgTreeSelector()
@ -334,6 +339,7 @@
const exportBatchUser = (params) => { const exportBatchUser = (params) => {
bizUserApi.userExport(params).then((res) => { bizUserApi.userExport(params).then((res) => {
downloadUtil.resultDownload(res) downloadUtil.resultDownload(res)
table.value.clearSelected()
}) })
} }
// //

View File

@ -33,7 +33,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -106,6 +106,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const loadTreeData = () => { const loadTreeData = () => {
const param = { const param = {

View File

@ -33,7 +33,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -105,6 +105,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const loadTreeData = () => { const loadTreeData = () => {
const param = { const param = {

View File

@ -22,7 +22,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -131,13 +131,17 @@
} }
} }
} }
// Promise // Promise
const loadData = (parameter) => { const loadData = (parameter) => {
return emailApi.emailPage(Object.assign(parameter, searchFormState)).then((data) => { return emailApi.emailPage(Object.assign(parameter, searchFormState)).then((data) => {
return data return data
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
const engineOptions = tool.dictList('EMAIL_ENGINE') const engineOptions = tool.dictList('EMAIL_ENGINE')
// //
const deleteEmail = (record) => { const deleteEmail = (record) => {

View File

@ -17,7 +17,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -99,7 +99,6 @@
</template> </template>
<script setup name="devFile"> <script setup name="devFile">
import { message } from 'ant-design-vue'
import fileApi from '@/api/dev/fileApi' import fileApi from '@/api/dev/fileApi'
import uploadForm from './uploadForm.vue' import uploadForm from './uploadForm.vue'
import detail from './detail.vue' import detail from './detail.vue'
@ -169,6 +168,11 @@
return data return data
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const deleteFile = (record) => { const deleteFile = (record) => {
let params = [ let params = [

View File

@ -1,6 +1,6 @@
<template> <template>
<a-card :bordered="false" :body-style="{ 'padding-bottom': '0px' }" class="mb-2"> <a-card :bordered="false" :body-style="{ 'padding-bottom': '0px' }" class="mb-2">
<a-form ref="formRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form"> <a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="6"> <a-col :span="6">
<a-form-item label="关键字" name="searchKey"> <a-form-item label="关键字" name="searchKey">
@ -19,7 +19,7 @@
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-button type="primary" @click="table.refresh(true)"></a-button> <a-button type="primary" @click="table.refresh(true)"></a-button>
<a-button style="margin: 0 8px" @click="() => formRef.resetFields()">重置</a-button> <a-button style="margin: 0 8px" @click="reset"></a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -78,12 +78,11 @@
</template> </template>
<script setup name="devJob"> <script setup name="devJob">
import { message } from 'ant-design-vue'
import tool from '@/utils/tool' import tool from '@/utils/tool'
import Form from './form.vue' import Form from './form.vue'
import jobApi from '@/api/dev/jobApi' import jobApi from '@/api/dev/jobApi'
let searchFormState = reactive({}) let searchFormState = reactive({})
const formRef = ref() const searchFormRef = ref()
const table = ref() const table = ref()
let form = ref() let form = ref()
const statusLoading = ref(false) const statusLoading = ref(false)
@ -146,6 +145,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const editJobStatus = (record) => { const editJobStatus = (record) => {
statusLoading.value = true statusLoading.value = true

View File

@ -12,7 +12,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -53,7 +53,6 @@
</template> </template>
<script setup name="devMessage"> <script setup name="devMessage">
import { message } from 'ant-design-vue'
import messageApi from '@/api/dev/messageApi' import messageApi from '@/api/dev/messageApi'
import Form from './form.vue' import Form from './form.vue'
import detail from './detail.vue' import detail from './detail.vue'
@ -110,6 +109,11 @@
return data return data
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const deleteMessage = (record) => { const deleteMessage = (record) => {
let params = [ let params = [

View File

@ -22,7 +22,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -69,7 +69,6 @@
</template> </template>
<script setup name="devSms"> <script setup name="devSms">
import { message } from 'ant-design-vue'
import smsApi from '@/api/dev/smsApi' import smsApi from '@/api/dev/smsApi'
import Form from './form.vue' import Form from './form.vue'
import detail from './detail.vue' import detail from './detail.vue'
@ -139,6 +138,11 @@
return data return data
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
const engineOptions = tool.dictList('SMS_ENGINE') const engineOptions = tool.dictList('SMS_ENGINE')
// //
const deleteSms = (record) => { const deleteSms = (record) => {

View File

@ -17,7 +17,7 @@
<a-space> <a-space>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入模块名称关键词"></a-input> <a-input v-model:value="searchFormState.searchKey" placeholder="请输入模块名称关键词"></a-input>
<a-button type="primary" @click="table.refresh(true)"></a-button> <a-button type="primary" @click="table.refresh(true)"></a-button>
<a-button style="margin: 0 8px" @click="() => searchFormRef.resetFields()">重置</a-button> <a-button style="margin: 0 8px" @click="reset"></a-button>
</a-space> </a-space>
</a-form-item> </a-form-item>
</a-space> </a-space>
@ -183,6 +183,11 @@
}) })
} }
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const moduleClock = (value) => { const moduleClock = (value) => {
searchFormState.module = value searchFormState.module = value

View File

@ -9,7 +9,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-button type="primary" @click="table.refresh(true)"></a-button> <a-button type="primary" @click="table.refresh(true)"></a-button>
<a-button style="margin: 0 8px" @click="() => formRef.resetFields()">重置</a-button> <a-button style="margin: 0 8px" @click="reset"></a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -56,7 +56,6 @@
</template> </template>
<script setup name="mobileModule"> <script setup name="mobileModule">
import { message } from 'ant-design-vue'
import Form from './form.vue' import Form from './form.vue'
import moduleApi from '@/api/mobile/resource/moduleApi' import moduleApi from '@/api/mobile/resource/moduleApi'
let searchFormState = reactive({}) let searchFormState = reactive({})
@ -110,12 +109,11 @@
return res return res
}) })
} }
// //
const onSearch = () => { const reset = () => {
if (searchFormState.searchKey) { formRef.value.resetFields();
table.value.refresh(true) table.value.refresh(true)
} }
}
// //
const deleteModule = (record) => { const deleteModule = (record) => {
let params = [ let params = [

View File

@ -26,7 +26,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -132,6 +132,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const loadTreeData = () => { const loadTreeData = () => {
orgApi.orgTree().then((res) => { orgApi.orgTree().then((res) => {

View File

@ -27,7 +27,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -133,6 +133,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
orgApi.orgTree().then((res) => { orgApi.orgTree().then((res) => {
cardLoading.value = false cardLoading.value = false

View File

@ -39,7 +39,6 @@
</template> </template>
<script setup> <script setup>
import { message } from 'ant-design-vue'
import fieldApi from '@/api/sys/resource/fieldApi' import fieldApi from '@/api/sys/resource/fieldApi'
import Form from './form.vue' import Form from './form.vue'
const columns = [ const columns = [

View File

@ -9,7 +9,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-button type="primary" @click="table.refresh(true)"></a-button> <a-button type="primary" @click="table.refresh(true)"></a-button>
<a-button style="margin: 0 8px" @click="() => formRef.resetFields()">重置</a-button> <a-button style="margin: 0 8px" @click="reset"></a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -56,7 +56,6 @@
</template> </template>
<script setup name="sysModule"> <script setup name="sysModule">
import { message } from 'ant-design-vue'
import Form from './form.vue' import Form from './form.vue'
import moduleApi from '@/api/sys/resource/moduleApi' import moduleApi from '@/api/sys/resource/moduleApi'
let searchFormState = reactive({}) let searchFormState = reactive({})
@ -110,6 +109,11 @@
return res return res
}) })
} }
//
const reset = () => {
formRef.value.resetFields();
table.value.refresh(true)
}
// //
const deleteModule = (record) => { const deleteModule = (record) => {
let params = [ let params = [

View File

@ -20,7 +20,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-button type="primary" html-type="submit" @click="table.refresh()"></a-button> <a-button type="primary" html-type="submit" @click="table.refresh()"></a-button>
<a-button style="margin: 0 8px" @click="() => formRef.resetFields()">重置</a-button> <a-button style="margin: 0 8px" @click="reset"></a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -164,6 +164,11 @@
return res return res
}) })
} }
//
const reset = () => {
formRef.value.resetFields();
table.value.refresh(true)
}
// //
const removeSpa = (record) => { const removeSpa = (record) => {
let params = [ let params = [

View File

@ -27,7 +27,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
查询 查询
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
重置 重置
</a-button> </a-button>
@ -179,6 +179,11 @@
return res return res
}) })
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
orgApi.orgTree().then((res) => { orgApi.orgTree().then((res) => {
cardLoading.value = false cardLoading.value = false

View File

@ -39,7 +39,7 @@
<template #icon><SearchOutlined /></template> <template #icon><SearchOutlined /></template>
{{ $t('common.searchButton') }} {{ $t('common.searchButton') }}
</a-button> </a-button>
<a-button class="snowy-buttom-left" @click="() => searchFormRef.resetFields()"> <a-button class="snowy-buttom-left" @click="reset">
<template #icon><redo-outlined /></template> <template #icon><redo-outlined /></template>
{{ $t('common.resetButton') }} {{ $t('common.resetButton') }}
</a-button> </a-button>
@ -262,6 +262,11 @@
} }
} }
} }
//
const reset = () => {
searchFormRef.value.resetFields();
table.value.refresh(true)
}
// //
const treeSelect = (selectedKeys) => { const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) { if (selectedKeys.length > 0) {
@ -328,8 +333,10 @@
} }
// //
const exportBatchUser = (params) => { const exportBatchUser = (params) => {
console.log(JSON.stringify(params))
userApi.userExport(params).then((res) => { userApi.userExport(params).then((res) => {
downloadUtil.resultDownload(res) downloadUtil.resultDownload(res)
table.value.clearSelected()
}) })
} }
// //