|
@@ -8,10 +8,10 @@
|
|
|
<span style="margin-left:10px">返回研修总览</span>
|
|
|
</div>
|
|
|
<div class="train-top-info">
|
|
|
- <div class="img-box" :style="{backgroundImage: `url(${trainInfo.detail.img || defImg})`}"></div>
|
|
|
+ <div class="img-box" :style="{backgroundImage: `url(${trainInfo.img || defImg})`}"></div>
|
|
|
<div class="infos">
|
|
|
<p class="title">
|
|
|
- <span>{{trainInfo.detail.topic}}</span>
|
|
|
+ <span>{{trainInfo.topic}}</span>
|
|
|
<span class="hour">{{trainInfo.hour}}学时</span>
|
|
|
</p>
|
|
|
<div class="info-item">
|
|
@@ -19,7 +19,7 @@
|
|
|
主讲老师:
|
|
|
</span>
|
|
|
<span>
|
|
|
- {{trainInfo.detail.presenter}}
|
|
|
+ {{trainInfo.presenter}}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
@@ -27,7 +27,7 @@
|
|
|
培训主题:
|
|
|
</span>
|
|
|
<span>
|
|
|
- {{trainInfo.detail.topic}}
|
|
|
+ {{trainInfo.topic}}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
@@ -35,7 +35,7 @@
|
|
|
培训地点:
|
|
|
</span>
|
|
|
<span>
|
|
|
- {{trainInfo.detail.address}}
|
|
|
+ {{trainInfo.address}}
|
|
|
</span>
|
|
|
</div>
|
|
|
<div class="info-item">
|
|
@@ -43,7 +43,7 @@
|
|
|
培训时间:
|
|
|
</span>
|
|
|
<span>
|
|
|
- <span>{{dateFormat(trainInfo.detail.startTime) + ' 至 ' + dateFormat(trainInfo.detail.endTime)}}</span>
|
|
|
+ <span>{{dateFormat(trainInfo.startTime) + ' 至 ' + dateFormat(trainInfo.endTime)}}</span>
|
|
|
<!-- {{trainInfo.time.join(' 至 ')}} -->
|
|
|
</span>
|
|
|
</div>
|
|
@@ -109,7 +109,7 @@
|
|
|
</Table>
|
|
|
</TabPane>
|
|
|
<TabPane label="问卷反馈" name="name3" class="tab-pane-wrap" v-if="trainInfo.settings.includes('survey')" style="height:600px">
|
|
|
- <Table :columns="surveyColumns" :data="surveyTableData" class="table-box" :height="580">
|
|
|
+ <Table :columns="surveyColumns" :data="tableData" class="table-box" :height="580">
|
|
|
<template slot-scope="{ row }" slot="surveytTime">
|
|
|
<span>{{dateFormat(row.time)}}</span>
|
|
|
</template>
|
|
@@ -121,13 +121,13 @@
|
|
|
</Table>
|
|
|
</TabPane>
|
|
|
<TabPane label="评测反馈" name="name4" class="tab-pane-wrap" v-if="trainInfo.settings.includes('exam')" style="height:600px">
|
|
|
- <Table :columns="examColumns" :data="examTableData" class="table-box" :height="580">
|
|
|
+ <Table :columns="examColumns" :data="tableData" class="table-box" :height="580">
|
|
|
<template slot-scope="{ row }" slot="examTime">
|
|
|
- <span>{{dateFormat(row.time)}}</span>
|
|
|
+ <span>{{dateFormat(row.examTime)}}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row,index }" slot="action">
|
|
|
- <Button type="primary" size="small" :disabled="!row.time" @click="toViewExam(index)">
|
|
|
- {{row.time ? '查看详情' : '暂未作答'}}
|
|
|
+ <Button type="primary" size="small" :disabled="!row.examTime" @click="toViewExam(index)">
|
|
|
+ {{row.examTime ? '查看详情' : '暂未作答'}}
|
|
|
</Button>
|
|
|
</template>
|
|
|
</Table>
|
|
@@ -361,7 +361,7 @@
|
|
|
<span class="tea-info-label">作业附件:</span>
|
|
|
<span>{{getFileName(tableData[viewIndex].hw)}}</span>
|
|
|
</p>
|
|
|
-
|
|
|
+
|
|
|
<div v-if="tableData[viewIndex]">
|
|
|
<video v-if="tableData[viewIndex].fileType == 'video'" id="previewVideo" :src="tableData[viewIndex].url" width="870" controls="controls" style="max-height: 800px;">
|
|
|
{{$t('teachContent.tips8')}}
|
|
@@ -382,10 +382,10 @@
|
|
|
</div>
|
|
|
</Modal>
|
|
|
<Modal v-model="surveyStatus" title="作答详情" width="800">
|
|
|
- <SurveyDetail v-if="surveyInfo" :survey="surveyInfo" :answer="surveyTableData[surveyIndex].answer" :schoolInfo="schoolInfo"></SurveyDetail>
|
|
|
+ <SurveyDetail v-if="surveyInfo && tableData[surveyIndex]" :survey="surveyInfo" :answer="tableData[surveyIndex].surveyAnswer" :schoolInfo="schoolInfo"></SurveyDetail>
|
|
|
</Modal>
|
|
|
<Modal v-model="examStatus" title="作答详情" width="800">
|
|
|
- <SurveyDetail v-if="examInfo && examTableData[examIndex]" :survey="examInfo" :answer="examTableData[examIndex].answer" :schoolInfo="schoolInfo"></SurveyDetail>
|
|
|
+ <SurveyDetail v-if="examInfo && tableData[examIndex]" :survey="examInfo" :answer="tableData[examIndex].examAnswer || []" :schoolInfo="schoolInfo"></SurveyDetail>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -402,7 +402,9 @@ export default {
|
|
|
curSchool: '',
|
|
|
schoolList: [],
|
|
|
trainList: [],
|
|
|
+ allTeacherList: [],
|
|
|
examAllData: [],
|
|
|
+ workAllData: [],
|
|
|
surveyAllData: [],
|
|
|
hwAndSignData: [],
|
|
|
examStatus: false,
|
|
@@ -423,7 +425,6 @@ export default {
|
|
|
defImg: 'https://www.habook.com.cn/data/editor/images/img/20210429%2001/001.png',
|
|
|
tabName: 'name',
|
|
|
trainInfo: {
|
|
|
- detail: {},
|
|
|
settings: []
|
|
|
},
|
|
|
columns: [
|
|
@@ -546,10 +547,10 @@ export default {
|
|
|
unupload: 0,
|
|
|
rate: 0
|
|
|
}
|
|
|
- if (this.hwAndSignData) {
|
|
|
- this.hwAndSignData.forEach(item => {
|
|
|
+ if (this.workAllData) {
|
|
|
+ this.workAllData.forEach(item => {
|
|
|
data.all += item.count
|
|
|
- data.uploaded += item.hwCount
|
|
|
+ data.uploaded += item.ansCount
|
|
|
})
|
|
|
data.unupload = data.all - data.uploaded
|
|
|
data.rate = (data.uploaded * 100 / data.all).toFixed(1)
|
|
@@ -619,7 +620,7 @@ export default {
|
|
|
content: '删除区级活动后,相关学校将无法参与此活动,确认删除活动吗?',
|
|
|
onOk: () => {
|
|
|
let params = {
|
|
|
- id: this.trainList[0].acId,
|
|
|
+ id: this.trainList[0].pId,
|
|
|
areaId: this.areaId,
|
|
|
pk: 'Study'
|
|
|
}
|
|
@@ -682,7 +683,7 @@ export default {
|
|
|
})
|
|
|
if (tInfo) {
|
|
|
let params = {
|
|
|
- id: tInfo.detail.surveyId,
|
|
|
+ id: tInfo.surveyId,
|
|
|
code: tInfo.school
|
|
|
}
|
|
|
this.$api.ability.getSurveySummary(params).then(
|
|
@@ -707,7 +708,6 @@ export default {
|
|
|
this.tableData = []
|
|
|
this.tableData = data
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
err => {
|
|
|
|
|
@@ -721,29 +721,70 @@ export default {
|
|
|
})
|
|
|
if (tInfo) {
|
|
|
let params = {
|
|
|
- id: tInfo.detail.examId,
|
|
|
+ id: tInfo.examId,
|
|
|
code: tInfo.school
|
|
|
}
|
|
|
this.$api.ability.getExamSummary(params).then(
|
|
|
res => {
|
|
|
- if (res.trExams && res.trExams[0]) {
|
|
|
- res.trExams[0].teachers.forEach(item => {
|
|
|
- item.answer = item.answer || []
|
|
|
- })
|
|
|
- this.examInfo = res.trExams[0]
|
|
|
- this.examTableData = this.examInfo.teachers
|
|
|
- this.tableData.forEach(item => {
|
|
|
- let t = this.examTableData.find(s => {
|
|
|
- return item.id == s.id
|
|
|
+ if (res.examLite) {
|
|
|
+ // let schoolTeacher = this.allTeacherList.find(item => { item.school == this.curSchool })
|
|
|
+ if (this.tableData) {
|
|
|
+ console.log('表格数据', this.tableData)
|
|
|
+ res.examLite.teachers.forEach(item => {
|
|
|
+ let curT = this.tableData.find(t => {
|
|
|
+ return t.id == item.id
|
|
|
+ })
|
|
|
+ console.log('123', curT)
|
|
|
+ if (curT) {
|
|
|
+ curT.examTime = item.time
|
|
|
+ curT.examAnswer = item.answer
|
|
|
+ }
|
|
|
})
|
|
|
- if (t) {
|
|
|
- item.examTime = t.time
|
|
|
- item.examAnswer = t.answer
|
|
|
- }
|
|
|
- })
|
|
|
- let data = JSON.parse(JSON.stringify(this.tableData))
|
|
|
- this.tableData = []
|
|
|
- this.tableData = data
|
|
|
+ this.examInfo = res.examLite
|
|
|
+ let data = JSON.parse(JSON.stringify(this.tableData))
|
|
|
+ this.tableData = []
|
|
|
+ this.tableData = data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getWorkInfo() {
|
|
|
+ let tInfo = this.trainList.find(item => {
|
|
|
+ return item.school == this.curSchool
|
|
|
+ })
|
|
|
+ if (tInfo) {
|
|
|
+ let params = {
|
|
|
+ id: tInfo.workId,
|
|
|
+ code: tInfo.school
|
|
|
+ }
|
|
|
+ this.$api.ability.getWorkSummary(params).then(
|
|
|
+ async res => {
|
|
|
+ let sasData = await this.$tools.getSchoolSas()
|
|
|
+ if (res.works && res.works.length) {
|
|
|
+ if (this.tableData) {
|
|
|
+ res.works[0].teachers.forEach(item => {
|
|
|
+ let curT = this.tableData.find(t => {
|
|
|
+ return t.id == item.id
|
|
|
+ })
|
|
|
+ if (curT) {
|
|
|
+ let info = this.getExAndType(item.hw)
|
|
|
+ curT.fileType = info.type
|
|
|
+ curT.extension = info.ex
|
|
|
+ curT.hwTime = item.hwTime
|
|
|
+ curT.hw = item.hw
|
|
|
+ curT.url = `${sasData.url}/${sasData.name}${item.hw}${sasData.sas}`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.workInfo = res.works[0]
|
|
|
+ let data = JSON.parse(JSON.stringify(this.tableData))
|
|
|
+ this.tableData = []
|
|
|
+ this.tableData = data
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
err => {
|
|
@@ -784,10 +825,10 @@ export default {
|
|
|
let link = window.location.origin + '/phonesign'
|
|
|
let id = this.trainInfo.id
|
|
|
let school = this.$store.state.userInfo.schoolCode
|
|
|
- let topic = this.trainInfo.detail.topic
|
|
|
- let address = this.trainInfo.detail.address
|
|
|
- let presenter = this.trainInfo.detail.presenter
|
|
|
- let time = `${this.dateFormat(this.trainInfo.detail.startTime)} 至 ${this.dateFormat(this.trainInfo.detail.endTime)}`
|
|
|
+ let topic = this.trainInfo.topic
|
|
|
+ let address = this.trainInfo.address
|
|
|
+ let presenter = this.trainInfo.presenter
|
|
|
+ let time = `${this.dateFormat(this.trainInfo.startTime)} 至 ${this.dateFormat(this.trainInfo.endTime)}`
|
|
|
let url = `${link}?isOpen=${this.isOpen}&id=${id}&school=${school}&topic=${topic}&address=${address}&presenter=${presenter}&time=${time}&random=${random}`
|
|
|
//这里需要根据站点动态拼接域名
|
|
|
let addr = this.$store.state.config.srvAdr
|
|
@@ -873,21 +914,17 @@ export default {
|
|
|
let tInfo = this.trainList.find(item => {
|
|
|
return item.school == this.curSchool
|
|
|
})
|
|
|
- console.log('是什么', tInfo)
|
|
|
- if (tInfo) {
|
|
|
- console.log('当前学校活动数据', tInfo)
|
|
|
- this.tableData = []
|
|
|
+ let teacherInfo = this.allTeacherList.find(item => {
|
|
|
+ return item.school == this.curSchool
|
|
|
+ })
|
|
|
+ if (tInfo && teacherInfo) {
|
|
|
+ this.tableData = this._.cloneDeep(teacherInfo.teachers)
|
|
|
tInfo.teachers.forEach(item => {
|
|
|
- if (item.hw) {
|
|
|
- let info = this.getExAndType(item.hw)
|
|
|
- item.fileType = info.type
|
|
|
- item.extension = info.ex
|
|
|
- console.log('学校信息',this.schoolInfo)
|
|
|
- if (this.schoolInfo.uri) {
|
|
|
- item.url = `${this.schoolInfo.uri}${item.hw}?${this.schoolInfo.sas}`
|
|
|
- }
|
|
|
+ let curTea = this.tableData.find(tea => { return tea.id == item.id })
|
|
|
+ if (curTea) {
|
|
|
+ item.name = curTea.name
|
|
|
+ Object.assign(curTea, item)
|
|
|
}
|
|
|
- this.tableData.push(item)
|
|
|
})
|
|
|
if (this.trainInfo.settings.includes('survey')) {
|
|
|
this.getSurveyInfo()
|
|
@@ -895,6 +932,9 @@ export default {
|
|
|
if (this.trainInfo.settings.includes('exam')) {
|
|
|
this.getExamInfo()
|
|
|
}
|
|
|
+ if (this.trainInfo.settings.includes('hw')) {
|
|
|
+ this.getWorkInfo()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -907,8 +947,14 @@ export default {
|
|
|
this.$api.train.findAreaAllTrain(params).then(
|
|
|
res => {
|
|
|
if (res && res.studies && res.studies.length) {
|
|
|
- this.trainInfo = res.studies[0]
|
|
|
- this.trainList = res.studies
|
|
|
+ this.trainList = res.studies.map(item => { return item.stu })
|
|
|
+ this.allTeacherList = res.studies.map(item => {
|
|
|
+ return {
|
|
|
+ school: item.stu.school,
|
|
|
+ teachers: item.teac
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.trainInfo = this.trainList[0]
|
|
|
if (this.trainInfo.settings.includes('sign')) {
|
|
|
this.columns.push({
|
|
|
title: '签到时间',
|
|
@@ -949,11 +995,12 @@ export default {
|
|
|
align: 'center'
|
|
|
})
|
|
|
|
|
|
- let schoolIds = res.studies.map(item => {
|
|
|
+ let schoolIds = this.trainList.map(item => {
|
|
|
return item.school
|
|
|
})
|
|
|
|
|
|
this.examAllData = res.exam
|
|
|
+ this.workAllData = res.work
|
|
|
this.surveyAllData = res.survey
|
|
|
this.hwAndSignData = res.info
|
|
|
this.getSchoolList(schoolIds)
|
|
@@ -966,7 +1013,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getSchoolList(ids) {
|
|
|
- console.log(ids)
|
|
|
this.$api.ability.findAreaGroup({
|
|
|
id: this.areaId
|
|
|
}).then(
|