|
|
|
@ -54,6 +54,10 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
|
import axios from 'axios' |
|
|
|
|
import Setting from "@/setting"; |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
@ -64,6 +68,7 @@ export default { |
|
|
|
|
page: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
multipleSelection: [], |
|
|
|
|
token:util.local.get(Setting.tokenKey), |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
@ -88,11 +93,30 @@ export default { |
|
|
|
|
}, |
|
|
|
|
exportData() { // 导出 |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
let ids = this.multipleSelection.map(i => i.reportId); |
|
|
|
|
location.href = `${this.api.exportPracticeByStudentDetail}?ids=${ids.toString()}`; |
|
|
|
|
let ids = this.multipleSelection.map(item => { |
|
|
|
|
return item.reportId; |
|
|
|
|
}); |
|
|
|
|
axios.get(`${this.api.exportPracticeByStudentDetail}?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.$get(`${this.api.exportPracticeByStudentDetail}?projectId=${this.projectId}&token=${this.token}&ids=${ids.toString()}`); |
|
|
|
|
} else { |
|
|
|
|
location.href = `${this.api.exportPracticeByStudentDetail}?ids=`; |
|
|
|
|
axios.get(`${this.api.exportPracticeByStudentDetail}?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.exportPracticeByStudentDetail}?projectId=${this.projectId}&token=${this.token}&ids=`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
tableRowStyle({ row, column, rowIndex, columnIndex }) { |
|
|
|
|
if (rowIndex % 2 === 0) { |
|
|
|
|