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

63970

parent 95bb0165
...@@ -121,7 +121,7 @@ export function download(url, params, filename, config) { ...@@ -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)", }) downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
return service.post(url, params, { return service.post(url, params, {
transformRequest: [(params) => { return tansParams(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', responseType: 'blob',
...config ...config
}).then(async (data) => { }).then(async (data) => {
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
class="fourWordsBtn" class="fourWordsBtn"
icon="el-icon-upload2" icon="el-icon-upload2"
size="mini" size="mini"
:loading="exportLoading"
@click="handleExport" @click="handleExport"
>批量导出 >批量导出
</el-button> </el-button>
...@@ -253,6 +254,8 @@ ...@@ -253,6 +254,8 @@
<script> <script>
import { listArticle, delArticle, addArticle, updateArticle, listAllArticle } from '@/api/business/article' import { listArticle, delArticle, addArticle, updateArticle, listAllArticle } from '@/api/business/article'
import { parseTime } from '../../utils/ruoyi' import { parseTime } from '../../utils/ruoyi'
import fa from 'element-ui/src/locale/lang/fa'
import moment from 'moment'
export default { export default {
name: 'Article', name: 'Article',
...@@ -284,6 +287,8 @@ export default { ...@@ -284,6 +287,8 @@ export default {
loading: true, loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
// 导出加载状态
exportLoading: false,
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -496,15 +501,20 @@ export default { ...@@ -496,15 +501,20 @@ export default {
/** 功能按钮--导出按钮操作 */ /** 功能按钮--导出按钮操作 */
handleExport() { handleExport() {
console.log('queryParams', this.queryParams) console.log('queryParams', this.queryParams)
// 开始loading
this.exportLoading = true
this.download('business/article/export', { this.download('business/article/export', {
...this.queryParams, ...this.queryParams,
params: { params: {
sort: this.queryParams.params.sort, sort: this.queryParams.params.sort,
idList: this.ids 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) { 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