Commit 8b660402 by zhangquan

导出加节流

1 parent 4c14a329
...@@ -34,6 +34,20 @@ ...@@ -34,6 +34,20 @@
</template> </template>
<script> <script>
const throttle = function(fn, time) {
let timer = null
time = time || 1000
return function (...args) {
if (timer) {
return
}
const _this = this
timer = setTimeout(() => {
timer = null
}, time)
fn.apply(_this, args)
}
}
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import utils from '../../util/util' import utils from '../../util/util'
import pdfDialog from '@/views/beforeSale/pdfDialog' import pdfDialog from '@/views/beforeSale/pdfDialog'
...@@ -297,7 +311,7 @@ ...@@ -297,7 +311,7 @@
}, },
// 导出 // 导出
handleExport() { handleExport: throttle(function() {
var params = this.getParams() var params = this.getParams()
this.$apis.contractManager.exportContractApi(params).then(res => { this.$apis.contractManager.exportContractApi(params).then(res => {
// window.open(res) // window.open(res)
...@@ -311,7 +325,7 @@ ...@@ -311,7 +325,7 @@
document.body.appendChild(iframe) document.body.appendChild(iframe)
} }
}) })
}, }, 1000),
handleSearch() { handleSearch() {
this.$refs.equityRef.refreshTable() this.$refs.equityRef.refreshTable()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!