From 5e2aafeede13d337380f736567caf74f49713be7 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:38:32 +0800
Subject: [PATCH] 代码优化
---
src/views/article/components/deitDiscussion.vue | 30 ++++++++++++------------------
1 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/src/views/article/components/deitDiscussion.vue b/src/views/article/components/deitDiscussion.vue
index e30c9a1..62935bb 100644
--- a/src/views/article/components/deitDiscussion.vue
+++ b/src/views/article/components/deitDiscussion.vue
@@ -32,8 +32,8 @@
<el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose">
<basic-container>
- <avue-crud :data="userData" :page="userPage" :option="userOption" @search-change="searchChange"
- @search-reset="searchReset">
+ <avue-crud :data="userData" :page="userPage" :option="userOption" @current-change="currentChange"
+ @search-change="searchChange" @search-reset="searchReset">
<template slot-scope="{type,size,row }" slot="menuLeft">
<el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
</el-button>
@@ -368,6 +368,9 @@
},
methods: {
+ currentChange(currentPage) {
+ this.userPage.currentPage = currentPage
+ },
addC(number) {
console.log("******************", number)
@@ -423,23 +426,14 @@
...this.query
}
data = Qs.stringify(data)
- if (this.type == 0 && this.newData.articleType === 4) {
- exportBlob(
- `/api/blade-userTopics/userTopics/exportDataIndex?${this.website.tokenHeader}=${getToken()}&` + data
- ).then(
+ exportBlob(
+ `/api/blade-userTopics/userTopics/exportUser?${this.website.tokenHeader}=${getToken()}&` + data)
+ .then(
res => {
- downloadXls(res.data, `投票统计${dateNow()}.xlsx`)
+ downloadXls(res.data, `投票人员${dateNow()}.xlsx`)
NProgress.done()
})
- } else {
- exportBlob(
- `/api/blade-userTopics/userTopics/exportUser?${this.website.tokenHeader}=${getToken()}&` + data)
- .then(
- res => {
- downloadXls(res.data, `投票人员${dateNow()}.xlsx`)
- NProgress.done()
- })
- }
+
})
},
@@ -472,7 +466,7 @@
done()
},
- openUser(row, type = 0) {
+ openUser(row, type) {
this.type = type
this.popupTableUserShow = true
this.query = {}
@@ -695,4 +689,4 @@
}
</script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>
\ No newline at end of file
--
Gitblit v1.9.3