dev_202412
yujialong 1 month ago
parent 7350d37739
commit 4fe500de03
  1. 2
      src/layouts/home/index.vue
  2. 2
      src/layouts/sidebar/index.vue
  3. 1
      src/pages/achievement/show/index.vue
  4. 162
      src/pages/assessment/add/index.vue
  5. 8
      src/pages/lesson/content/index.vue
  6. 2
      src/pages/lesson/content/source.vue
  7. 6
      src/pages/lesson/detail/index.vue
  8. 2
      src/pages/station/preview/index.vue

@ -215,7 +215,7 @@ export default {
// height: calc(100vh - 213px); // height: calc(100vh - 213px);
padding: 24px; padding: 24px;
margin-bottom: 20px; margin-bottom: 20px;
transition: all 0.3s ease-in-out; // transition: all 0.3s ease-in-out;
overflow: auto; overflow: auto;
} }
} }

@ -102,7 +102,7 @@ export default {
width: 160px; width: 160px;
height: calc(100vh - 173px); height: calc(100vh - 173px);
overflow: auto; overflow: auto;
transition: .5s; // transition: .5s;
transform: translateX(-200px); transform: translateX(-200px);
&.show { &.show {

@ -201,6 +201,7 @@ export default {
}, },
// //
handleList (list) { handleList (list) {
console.log("🚀 ~ handleList ~ list:", list)
this.isLc = list.find(e => e.lcRuleRecords) // lcRuleRecords this.isLc = list.find(e => e.lcRuleRecords) // lcRuleRecords
if (this.isLc) { if (this.isLc) {
list.map(e => { list.map(e => {

@ -52,20 +52,21 @@
<el-card shadow="hover" class="mgr20 m-b-20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="m-b-20">课程</p> <p class="m-b-20">课程</p>
<div class="inline-input">
<el-select v-model="form.mallId" @change="initData"> <el-radio-group v-model="courseTab" @change="courseChange">
<el-option v-for="item in curriculumList" :key="item.mallId" :label="item.curriculumName" <el-radio v-for="(item, i) in courseTypes" :key="i" :label="item.id">{{ item.name
:value="item.mallId"> }}</el-radio>
</el-radio-group>
<div class="inline-input m-t-10">
<el-select v-if="courseTab" v-model="form.curriculumId" @change="initData">
<el-option v-for="(item, i) in curriculumList" :key="i" :label="item.curriculumName" :value="item.cid">
</el-option>
</el-select>
<el-select v-else v-model="form.curriculumId" @change="initData">
<el-option v-for="(item, i) in myCurs" :key="i" :label="item.curriculumName" :value="item.cid">
</el-option> </el-option>
</el-select> </el-select>
<!-- <el-select v-model="form.curriculumId" @change="initData">
<el-option
v-for="item in systemList"
:key="item.id"
:label="item.label"
:value="item.id">
</el-option>
</el-select> -->
</div> </div>
</div> </div>
</el-card> </el-card>
@ -180,20 +181,31 @@ export default {
2: "竞赛" 2: "竞赛"
}, },
isDetail: Boolean(this.$route.query.show), isDetail: Boolean(this.$route.query.show),
courseTab: 1,
courseTypes: [
{
id: 1,
name: '校本课程'
},
{
id: 0,
name: '我的课程'
},
],
form: { form: {
id: this.$route.query.id ? this.$route.query.id : "", id: this.$route.query.id ? this.$route.query.id : '',
experimentalName: "", experimentalName: '',
type: 1, // (1 2) type: 1, // (1 2)
experimentDuration: "0d0h0m", experimentDuration: "0d0h0m",
curriculumId: "", curriculumId: '',
mallId: '', mallId: '',
projectId: '', projectId: '',
paperId: '', paperId: '',
isSpecify: 1, // (1 0) isSpecify: 1, // (1 0)
isEnableCode: 0, // isEnableCode: 0, //
invitationCode: "", invitationCode: '',
status: 0, // (0 1 2) status: 0, // (0 1 2)
classId: "", classId: '',
stuInfo: [] stuInfo: []
}, },
date: "", // date: "", //
@ -206,6 +218,7 @@ export default {
stopTime: "0000-00-00 00:00:00", // stopTime: "0000-00-00 00:00:00", //
expNameRepeat: false, // expNameRepeat: false, //
curriculumList: [], // curriculumList: [], //
myCurs: [],
filterClassName: "", // filterClassName: "", //
tagList: [], // tagList: [], //
defaultCheckedKeys: [], // defaultCheckedKeys: [], //
@ -254,9 +267,8 @@ export default {
}, },
mounted () { mounted () {
this.date = [Util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000)), Util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000))]; this.date = [Util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000)), Util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000))];
this.form.id && this.getData(); this.form.id ? this.getData() : this.getMallCourse()
this.recoveryData(); this.recoveryData()
this.getschoolCourse();
}, },
watch: { watch: {
// , // ,
@ -294,6 +306,19 @@ export default {
...mapActions("project", [ ...mapActions("project", [
"setAss" "setAss"
]), ]),
async getData () { //
const { data } = await this.$get(`${this.api.getDetailById}?id=${this.form.id}`)
data.uuid = data.projectId || data.paperId
this.form = data
if (!data.mallId) {
this.courseTab = 0
this.getMyCourse()
}
this.startTime = data.startTime
this.stopTime = data.stopTime
this.formatDuration()
this.getMallCourse()
},
handleCloseTag (tag) { // handleCloseTag (tag) { //
this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes()); this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
let tagIndex = this.tagList.findIndex(i => i.id === tag.id); let tagIndex = this.tagList.findIndex(i => i.id === tag.id);
@ -367,30 +392,43 @@ export default {
return resolve([]); return resolve([]);
} }
}, },
getschoolCourse () { // async getMallCourse (fromChange) { //
this.$get(this.api.getSchoolEffectiveCourse).then(({ data }) => { const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
this.curriculumList = data; this.curriculumList = data
if (this.curriculumList.length) { if (this.curriculumList.length) {
if (!this.form.mallId) this.form.mallId = data[0].mallId if (!this.form.curriculumId || fromChange) this.form.curriculumId = data[0].cid
this.getProjectData() this.getProjectData()
} }
if (!fromChange) {
this.$nextTick(() => { this.$nextTick(() => {
this.updateTime = 0 this.updateTime = 0
}) })
}).catch(err => { }); }
},
//
async getMyCourse (fromChange) {
const res = await this.$get(this.api.getchoolBuiltCoursesList)
const data = res.schoolCourse
this.myCurs = data
if (fromChange) this.form.curriculumId = data[0].cid
this.getProjectData()
},
//
courseChange (val) {
val ? this.getMallCourse(1) : this.getMyCourse(1)
}, },
getProjectData () { getProjectData () {
const curItem = this.curriculumList.find(e => e.mallId === this.form.mallId) const cur = this.courseTab ? this.curriculumList.find(e => e.cid === this.form.curriculumId) : {}
let data = { this.$post(this.api.getProjectOrExamPaperByAssessment, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
cid: curItem.cid, cid: this.form.curriculumId,
projectName: this.keyword, projectName: this.keyword,
systemId: curItem ? curItem.systemId : 1, systemId: cur ? cur.systemId : '',
permissions: 1, permissions: 1,
mallId: this.form.mallId mallId: cur ? cur.mallId : ''
} }).then(({ data }) => {
this.$post(this.api.getProjectOrExamPaperByAssessment, data).then(({ data }) => {
const list = data.records const list = data.records
list.forEach(e => { list.forEach(e => {
e.uuid = e.projectId || e.paperId // e.uuid = e.projectId || e.paperId //
@ -420,9 +458,9 @@ export default {
let day = hour * 24; let day = hour * 24;
this.form.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m`; this.form.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m`;
} }
if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return Util.warningMsg("请填写考核时长"); if (form.type == 1 && this.form.experimentDuration == "0d0h0m") return Util.warningMsg("请填写考核时长");
if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return Util.warningMsg("请填写考核时间"); if (form.type == 2 && this.startTime == "0000-00-00 00:00:00") return Util.warningMsg("请填写考核时间");
if (this.form.type == 1) { if (form.type == 1) {
const { day, hour, minute } = this.duration const { day, hour, minute } = this.duration
if (String(day).includes('.')) return Util.warningMsg('考核天数请填写整数') if (String(day).includes('.')) return Util.warningMsg('考核天数请填写整数')
if (day < 0) return Util.warningMsg('考核天数请勿填写负数') if (day < 0) return Util.warningMsg('考核天数请勿填写负数')
@ -434,31 +472,37 @@ export default {
if (!form.uuid) return Util.warningMsg("请选择考核项目"); if (!form.uuid) return Util.warningMsg("请选择考核项目");
const item = this.projectData.find(e => form.uuid === e.projectId || form.uuid === e.paperId) const item = this.projectData.find(e => form.uuid === e.projectId || form.uuid === e.paperId)
if (item) form[item.projectId ? 'projectId' : 'paperId'] = form.uuid if (item) form[item.projectId ? 'projectId' : 'paperId'] = form.uuid
if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) { if (form.isSpecify == 0 && this.form.isEnableCode == 1) {
if (!this.form.invitationCode) return Util.warningMsg("请设置邀请码"); if (!form.invitationCode) return Util.warningMsg("请设置邀请码")
if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return Util.warningMsg("请输入6位纯数字邀请码"); if (!form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return Util.warningMsg("请输入6位纯数字邀请码")
} }
this.form.startTime = this.form.type == 2 ? this.startTime : '' form.startTime = form.type == 2 ? this.startTime : ''
this.form.stopTime = this.form.type == 2 ? this.stopTime : '' form.stopTime = form.type == 2 ? this.stopTime : ''
let classId = []; let classId = []
let stuInfo = []; let stuInfo = []
this.allCheckedNodes.forEach(i => { this.allCheckedNodes.forEach(i => {
if (i.level === 3) { if (i.level === 3) {
classId.push(i.id); classId.push(i.id)
} else if (i.level === 4) { } else if (i.level === 4) {
stuInfo.push({ classId: i.parentId, stuAccountId: i.id }); stuInfo.push({ classId: i.parentId, stuAccountId: i.id })
} }
}); })
if (this.isSpecify == 1 && !stuInfo.length) { if (this.isSpecify == 1 && !stuInfo.length) {
Util.warningMsg("请选择学生"); Util.warningMsg("请选择学生")
return; return
} else {
this.form.classId = classId.toString()
this.form.stuInfo = stuInfo
}
if (this.courseTab) {
const cur = this.curriculumList.find(e => e.cid === this.form.curriculumId)
form.mallId = cur.mallId
} else { } else {
this.form.classId = classId.toString(); form.mallId = ''
this.form.stuInfo = stuInfo;
} }
const curItem = this.curriculumList.find(e => e.mallId === this.form.mallId)
this.form.curriculumId = curItem.cid
this.submiting = true this.submiting = true
if (this.form.id) { if (this.form.id) {
this.$post(this.api.modifyAssessment, this.form).then(async res => { this.$post(this.api.modifyAssessment, this.form).then(async res => {
@ -478,16 +522,6 @@ export default {
}); });
} }
}, },
getData () { //
this.$get(`${this.api.getDetailById}?id=${this.form.id}`).then(({ data }) => {
this.form = data;
this.startTime = data.startTime
this.stopTime = data.stopTime
this.formatDuration();
this.getschoolCourse();
}).catch(err => {
});
},
formatDuration () { // formatDuration () { //
let duration = this.form.experimentDuration.replace(/\D+/g, ",").split(","); let duration = this.form.experimentDuration.replace(/\D+/g, ",").split(",");
this.duration = { this.duration = {

@ -400,7 +400,7 @@ export default {
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); })
}, },
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
if ((file.size / 1024 / 1024) < 10) { if ((file.size / 1024 / 1024) < 10) {
@ -408,7 +408,7 @@ export default {
} }
}, },
handleRemove () { handleRemove () {
Oss.del(this.fileUrl) // Oss.del(this.fileUrl)
this.fileUrl = '' this.fileUrl = ''
}, },
transferType (ext) { transferType (ext) {
@ -775,8 +775,8 @@ export default {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$del(`${this.api.deleteSubsectionCurriculm}/${row.id}`).then(res => { this.$del(`${this.api.deleteSubsectionCurriculm}/${row.id}`).then(res => {
row.fileUrl && Oss.del(row.fileUrl) // row.fileUrl && Oss.del(row.fileUrl)
this.$message.success("删除成功") this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => { }) }).catch(res => { })
}).catch(() => { }) }).catch(() => { })

@ -174,7 +174,6 @@ export default {
methods: { methods: {
// //
init () { init () {
this.getCourse()
this.checked = [] this.checked = []
this.curType = '全部' this.curType = '全部'
this.sourceType = [ this.sourceType = [
@ -187,6 +186,7 @@ export default {
this.sourceType.forEach(e => { this.sourceType.forEach(e => {
e.check = false e.check = false
}) })
this.getCourse()
}, },
// //
async getCourse () { async getCourse () {

@ -209,7 +209,7 @@
</div> </div>
<div v-if="step !== 4" class="btns"> <div v-if="step !== 4" class="btns">
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button> <el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button>
<el-button v-if="step < 3" type="primary" @click="save(1)">下一步</el-button> <el-button v-if="step < 3" type="primary" @click="save(1)">保存并下一步</el-button>
<el-button type="primary" @click="save()">保存</el-button> <el-button type="primary" @click="save()">保存</el-button>
<el-button @click="back">返回</el-button> <el-button @click="back">返回</el-button>
</div> </div>
@ -837,7 +837,7 @@ export default {
cid: this.cid, cid: this.cid,
systemIdByAssessment: list systemIdByAssessment: list
}) })
this.step = 4 this.back()
} finally { } finally {
this.submiting = false this.submiting = false
load.close() load.close()
@ -847,7 +847,7 @@ export default {
}, },
// //
toStep (i) { toStep (i) {
this.step = i if (!this.isAdd || (this.cid && i < this.step)) this.step = i
}, },
// //
back () { back () {

@ -324,6 +324,7 @@ import quill from "@/components/quill";
import pdfDia from '@/components/pdf' import pdfDia from '@/components/pdf'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/components/editor' import editorConfig from '@/components/editor'
import Cookies from 'js-cookie'
export default { export default {
components: { pdf, pdfDia, quill, Editor }, components: { pdf, pdfDia, quill, Editor },
data () { data () {
@ -963,6 +964,7 @@ export default {
window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${this.courseId}&projectId=${this.curProject}&token=${token}&userId=${this.userId}&classId=1&mallId=${this.mallId}${Setting.isTest ? '&beta=1' : ''}`); window.open(`http://${Setting.zcPath}?systemId=${systemId}&courseId=${this.courseId}&projectId=${this.curProject}&token=${token}&userId=${this.userId}&classId=1&mallId=${this.mallId}${Setting.isTest ? '&beta=1' : ''}`);
} else if (systemId == 19) { } else if (systemId == 19) {
// //
Cookies.set('sand-projectId', this.curProject)
location.href = `${Setting.sandPath}/#/?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&manager=1&referrer=${encodeURIComponent(location.href)}` location.href = `${Setting.sandPath}/#/?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&mallId=${this.mallId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&manager=1&referrer=${encodeURIComponent(location.href)}`
} else { } else {
// python // python

Loading…
Cancel
Save