添加ai及低代码平台跳转

master
yujialong 4 months ago
parent 8068572935
commit 2fec0e532b
  1. 2
      public/index.html
  2. 1
      src/api/index.js
  3. 54
      src/pages/achievement/info/project.vue
  4. 5
      src/pages/station/preview/index.vue

@ -10,7 +10,7 @@
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function() {
var hm = document.createElement('script'); var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e'; hm.src = 'https://hm.baidu.com/hm.js?e4d7deeca2d6ea71d2bd5fa2365bc654';
var s = document.getElementsByTagName('script')[0]; var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();

@ -127,6 +127,7 @@ export default {
exportProductPracticeResults: `${host}occupationlab/occupationlab/achievement/exportProductPracticeResults`, exportProductPracticeResults: `${host}occupationlab/occupationlab/achievement/exportProductPracticeResults`,
exportProductAssessResults: `${host}occupationlab/occupationlab/achievement/exportProductAssessResults`, exportProductAssessResults: `${host}occupationlab/occupationlab/achievement/exportProductAssessResults`,
exportMultipleExperimentalReports: `${host}occupationlab/occupationlab/achievement/exportMultipleExperimentalReports`, exportMultipleExperimentalReports: `${host}occupationlab/occupationlab/achievement/exportMultipleExperimentalReports`,
batchExportReportsAsZip: `${host}occupationlab/occupationlab/achievement/batchExportReportsAsZip`,
// 项目管理 // 项目管理
getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统 getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统

@ -76,14 +76,14 @@
<div v-if="curTab == 0"> <div v-if="curTab == 0">
<el-button type="primary" @click="delAllData">批量删除</el-button> <el-button type="primary" @click="delAllData">批量删除</el-button>
<el-button type="primary" @click="exportData">导出成绩列表</el-button> <el-button type="primary" @click="exportData">导出成绩列表</el-button>
<el-button type="primary" @click="exportReport">导出成绩报告</el-button> <el-button type="primary" :loading="exporting" @click="exportReport">导出成绩报告</el-button>
</div> </div>
<div v-else> <div v-else>
<el-button type="primary" @click="exportDataActivation">导出</el-button> <el-button type="primary" @click="exportDataActivation">导出</el-button>
</div> </div>
</div> </div>
<template v-if="curTab == 0"> <template v-if="curTab == 0">
<el-table :data="listData" :key="1" class="table" ref="table" stripe header-align="center" <el-table :data="list" :key="1" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="reportId"> @selection-change="handleSelectionChange" row-key="reportId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
@ -185,7 +185,7 @@ export default {
keyword: "", keyword: "",
searchTimer: null, searchTimer: null,
listDataAll: [], listDataAll: [],
listData: [], list: [],
multipleSelection: [], multipleSelection: [],
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
@ -212,7 +212,8 @@ export default {
pageSizeActivation: 10, pageSizeActivation: 10,
totalActivation: 0, totalActivation: 0,
loading: false, loading: false,
scores: {} scores: {},
exporting: false,
}; };
}, },
components: { components: {
@ -265,7 +266,7 @@ export default {
await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`) await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`)
// //
const isArr = res.page instanceof Array const isArr = res.page instanceof Array
this.listData = isArr ? res.page : res.page.records this.list = isArr ? res.page : res.page.records
this.total = isArr ? res.total : res.page.total this.total = isArr ? res.total : res.page.total
this.avgScore = (+res.avgScore).toFixed(2) this.avgScore = (+res.avgScore).toFixed(2)
this.examCount = res.examCount this.examCount = res.examCount
@ -331,45 +332,30 @@ export default {
}, },
// //
async exportReport () { async exportReport () {
// this.exporting = true
// reportId
let list = this.multipleSelection let list = this.multipleSelection
if (!this.multipleSelection.length) { let reportIds = []
// if (list.length) {
const res = this.permissions ? list.map(e => {
await this.$post(`${this.api.getAssessmentDetail}?pageNum=1&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}&mallId=${this.mallId}`) : e.reportId && reportIds.push(e.reportId)
await this.$post(`${this.api.getPracticeDetail}?pageNum=1&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`) })
list = res.page.records
} }
const res = await axios.post(this.api.exportMultipleExperimentalReports, list.map(e => e.reportId), { const data = {
mallId: this.mallId,
reportIds
}
data[this.permissions ? 'assessmentId' : 'projectId'] = this.id
const res = await axios.post(this.api.batchExportReportsAsZip, data, {
headers: { headers: {
token: this.token token: this.token
}, },
responseType: 'blob' responseType: 'blob'
}) })
const name = res.headers['content-disposition'] const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '成绩报告.xlsx', new Blob([res.data])) util.downloadFileDirect(name ? decodeURI(name) : '成绩报告.zip', new Blob([res.data]))
this.exporting = false this.exporting = false
return
list.forEach(async e => {
if (e.reportId) {
try {
const { report, userScores } = await this.$get(`${this.api.reportDetail}?reportId=${e.reportId}`)
userScores.map((e, i) => {
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
})
for (const i in report) {
if (report[i] && typeof report[i] === 'string') report[i] = report[i].replace(/<[^>]+>/g, '')
}
report.purpose = report.purpose.replace(/<[^>]+>/g, '')
const res = await this.$post(this.api[userScores.find(e => e.lcRuleRecords) ? 'exportBankExperimentReport' : 'exportLabReport'], {
...report,
experimentalData: userScores
})
util.downloadFileDirect(`${e.userName}的实验报告.docx`, new Blob([res]))
} catch (e) { }
}
})
}, },
handleDelete (row) { // handleDelete (row) { //
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {

@ -396,7 +396,8 @@ export default {
deleteIdentity: false, deleteIdentity: false,
archProject: '', archProject: '',
curReplyId: '', curReplyId: '',
maximumScores: [] maximumScores: [],
third: '',
}; };
}, },
computed: { computed: {
@ -850,6 +851,7 @@ export default {
projectId ? util.cookies.set('projectId', projectId) : util.cookies.set('projectId', '', -1) projectId ? util.cookies.set('projectId', projectId) : util.cookies.set('projectId', '', -1)
util.cookies.set('token', token) util.cookies.set('token', token)
util.cookies.set('mallId', this.mallId) util.cookies.set('mallId', this.mallId)
util.cookies.set('third', this.third)
util.cookies.set('courseId', this.courseId) util.cookies.set('courseId', this.courseId)
util.cookies.set('curriculumName', encodeURIComponent(this.curriculumName)) util.cookies.set('curriculumName', encodeURIComponent(this.curriculumName))
util.cookies.set('systemId', id) util.cookies.set('systemId', id)
@ -876,6 +878,7 @@ export default {
const { systemId } = curProject const { systemId } = curProject
let token = util.local.get(Setting.tokenKey); let token = util.local.get(Setting.tokenKey);
this.third = curProject.type === 2 ? (curProject.systemId === 28 ? 'low' : 'ai') : ''
if (systemId == 11) { if (systemId == 11) {
// //
sessionStorage.removeItem('projectId') sessionStorage.removeItem('projectId')

Loading…
Cancel
Save