Commit eef62b2a authored by 小费同学阿's avatar 小费同学阿 💬

63970

parent 95bb0165
......@@ -121,7 +121,7 @@ export function download(url, params, filename, config) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
return service.post(url, params, {
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
headers: { 'Content-Type': 'application/x-www-form-urlencoded', repeatSubmit: false },
responseType: 'blob',
...config
}).then(async (data) => {
......
......@@ -91,6 +91,7 @@
class="fourWordsBtn"
icon="el-icon-upload2"
size="mini"
:loading="exportLoading"
@click="handleExport"
>批量导出
</el-button>
......@@ -253,6 +254,8 @@
<script>
import { listArticle, delArticle, addArticle, updateArticle, listAllArticle } from '@/api/business/article'
import { parseTime } from '../../utils/ruoyi'
import fa from 'element-ui/src/locale/lang/fa'
import moment from 'moment'
export default {
name: 'Article',
......@@ -284,6 +287,8 @@ export default {
loading: true,
// 选中数组
ids: [],
// 导出加载状态
exportLoading: false,
// 非单个禁用
single: true,
// 非多个禁用
......@@ -496,15 +501,20 @@ export default {
/** 功能按钮--导出按钮操作 */
handleExport() {
console.log('queryParams', this.queryParams)
// 开始loading
this.exportLoading = true
this.download('business/article/export', {
...this.queryParams,
params: {
sort: this.queryParams.params.sort,
idList: this.ids
}
}, `article_${new Date().getTime()}.xlsx`)
}, `文章管理-${moment().format('YYYY-MM-DD')}.xlsx`)
// 重置选择
.then(_ => this.effectTableSelect([]))
.then(_ => {
this.effectTableSelect([])
this.$nextTick(_ => this.exportLoading = false)
})
},
/** 列表区--多选框选中数据 */
handleSelectionChange(selection) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment