修改导出接口

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. 9
      src/pages/assessment/list/index.vue

@ -77,8 +77,11 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default {
data() {
@ -97,7 +100,8 @@ export default {
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0 //
avgScore: 0, //
token: btoa(util.local.get(Setting.tokenKey)),
};
},
watch: {
@ -143,11 +147,27 @@ export default {
exportData() { // ()
if (this.multipleSelection.length) {
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 {
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) { //

@ -62,6 +62,8 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import axios from 'axios'
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
@ -127,9 +129,25 @@ export default {
let ids = this.multipleSelection.map(item => {
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 {
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) {

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

Loading…
Cancel
Save