修改导出接口

dev_2022-05-11
e 3 years ago
parent 4c8932f465
commit 0974ad6b2e
  1. 28
      src/pages/achievement/teach/index.vue
  2. 22
      src/pages/achievement/vir/index.vue
  3. 11
      src/pages/assessment/list/index.vue

@ -77,8 +77,11 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex";
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
import axios from 'axios';
export default { export default {
data() { data() {
@ -97,7 +100,8 @@ export default {
pageSize: 10, pageSize: 10,
total: 0, total: 0,
peopleNum: 0, // peopleNum: 0, //
avgScore: 0 // avgScore: 0, //
token: btoa(util.local.get(Setting.tokenKey)),
}; };
}, },
watch: { watch: {
@ -143,11 +147,27 @@ export default {
exportData() { // () exportData() { // ()
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.projectId; return item.reportId;
}); });
location.href = `${this.api.exportAssessmentInfo}?ids=${ids.toString()}`; axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&token=${this.token}&ids=${ids.toString()}`;
} else { } else {
location.href = `${this.api.exportAssessmentInfo}?ids=`; axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&ids=`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&token=${this.token}&ids=`;
} }
}, },
handleDelete(row) { // handleDelete(row) { //

@ -62,6 +62,8 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex";
import axios from 'axios'
import Setting from "@/setting"; import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
@ -127,9 +129,25 @@ export default {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.reportId; return item.reportId;
}); });
location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&token=${this.token}&ids=${ids.toString()}`; axios.get(`${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`;
} else { } else {
location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&token=${this.token}&ids=`; axios.get(`${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=`;
} }
}, },
handleDelete(row) { handleDelete(row) {

@ -187,7 +187,8 @@ export default {
multipleSelection: [], // multipleSelection: [], //
listLoading:false,// listLoading:false,//
ticker: null, // ticker: null, //
sss:1 sss:1,
datassdata:0,
}; };
}, },
watch: { watch: {
@ -263,6 +264,7 @@ export default {
} }
}, },
getData() { getData() {
this.datassdata = this.datassdata+1
this.listLoading = true; this.listLoading = true;
this.listData.splice(0); this.listData.splice(0);
this.sss = 0 this.sss = 0
@ -300,8 +302,11 @@ export default {
} }
} }
}); });
this.sss = 1 this.sss = 1;
this.beginTimer() if(this.datassdata == 1){
this.beginTimer()
}
// setTimeout(,3000)
this.listLoading = false; this.listLoading = false;
}).catch(err => { }).catch(err => {
this.listLoading = false; this.listLoading = false;

Loading…
Cancel
Save