Commit 745b8482 by 前端

Merge branch 'xuyl_dev_v3.2.0' into 'v3.2.0'

防抖

See merge request !81
2 parents 9f0e2d27 9bb7c329
export default function debounce(fn, delay) {
var t = null
return function() {
if (t) {
clearTimeout(t)
}
t = setTimeout(() => {
fn.apply(this, arguments)
}, delay)
}
}
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</div> </div>
<span slot='footer' class='dialog-footer'> <span slot='footer' class='dialog-footer'>
<el-button @click='dialogVisible = false'>取 消</el-button> <el-button @click='dialogVisible = false'>取 消</el-button>
<el-button type='primary' @click='comfirmDialog' <el-button type='primary' @click='handleDebounce'
>确 定</el-button >确 定</el-button
> >
</span> </span>
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
<script> <script>
import ProfitSearch from '@/views/profitManagement/profitList/cpns/ProfitSearch' import ProfitSearch from '@/views/profitManagement/profitList/cpns/ProfitSearch'
import debounce from '@/utils/debounce'
import { profitApi } from '@/api/profitManagement' import { profitApi } from '@/api/profitManagement'
import { withdrawalApi } from '@/api/withdrawalManagement'
export default { export default {
name: 'WithdrawalSearch', name: 'WithdrawalSearch',
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
dialogVisible: false, dialogVisible: false,
totalScore: '', totalScore: '',
choiceData: [], choiceData: [],
choiceDataBack:[], choiceDataBack: [],
pageConf: { pageConf: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageNum: 'pageNum', pageNum: 'pageNum',
...@@ -154,7 +154,8 @@ export default { ...@@ -154,7 +154,8 @@ export default {
prop: 'exchangeStaff' prop: 'exchangeStaff'
} }
] ]
} },
timeout:null
} }
}, },
methods: { methods: {
...@@ -206,7 +207,8 @@ export default { ...@@ -206,7 +207,8 @@ export default {
return { exchangeStatus, staffPhone, merchantName, isWithdrawal, rewardScore, id } return { exchangeStatus, staffPhone, merchantName, isWithdrawal, rewardScore, id }
}) })
}, },
async comfirmDialog() { handleDebounce:debounce(
async function(){
let arr = [] let arr = []
this.choiceDataBack && this.choiceDataBack.forEach(item => arr.push(item.id)) this.choiceDataBack && this.choiceDataBack.forEach(item => arr.push(item.id))
const params = { idList: arr } const params = { idList: arr }
...@@ -223,6 +225,8 @@ export default { ...@@ -223,6 +225,8 @@ export default {
}) })
this.dialogVisible = false this.dialogVisible = false
}, },
1000
),
// 导出 // 导出
handleOutput() { handleOutput() {
let params = JSON.parse(JSON.stringify(this.profitSearchForm)) let params = JSON.parse(JSON.stringify(this.profitSearchForm))
...@@ -262,7 +266,7 @@ export default { ...@@ -262,7 +266,7 @@ export default {
}, 500) }, 500)
}, },
reset() { reset() {
if (this.choiceData){ if (this.choiceData) {
this.$refs.profitTable.mutiSelectArr.list = [] this.$refs.profitTable.mutiSelectArr.list = []
this.$refs.profitTable.$children[0].clearSelection() this.$refs.profitTable.$children[0].clearSelection()
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div v-html='textTooltip'></div> <div v-html='textTooltip'></div>
<span slot='footer' class='dialog-footer'> <span slot='footer' class='dialog-footer'>
<el-button @click='dialogVisible = false'>取 消</el-button> <el-button @click='dialogVisible = false'>取 消</el-button>
<el-button type='primary' @click='comfirmDialog()' <el-button type='primary' @click='handleDebounce'
>确 定</el-button >确 定</el-button
> >
</span> </span>
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<script> <script>
import { withdrawalApi } from '@/api/withdrawalManagement' import { withdrawalApi } from '@/api/withdrawalManagement'
import debounce from '@/utils/debounce'
import { profitApi } from '@/api/profitManagement'
export default { export default {
name: 'WithdrawalDialog', name: 'WithdrawalDialog',
...@@ -22,7 +24,8 @@ export default { ...@@ -22,7 +24,8 @@ export default {
} }
}, },
methods: { methods: {
async comfirmDialog() { handleDebounce:debounce(
async function(){
const params = { const params = {
...JSON.parse(JSON.stringify( ...JSON.parse(JSON.stringify(
{ idList: this.auditId } { idList: this.auditId }
...@@ -39,7 +42,9 @@ export default { ...@@ -39,7 +42,9 @@ export default {
} }
) )
this.dialogVisible = false this.dialogVisible = false
} },
1000
),
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!