diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index 40e6bf2..57ca97a 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -215,7 +215,7 @@ export default { // height: calc(100vh - 213px); padding: 24px; margin-bottom: 20px; - transition: all 0.3s ease-in-out; + // transition: all 0.3s ease-in-out; overflow: auto; } } diff --git a/src/layouts/sidebar/index.vue b/src/layouts/sidebar/index.vue index bc9339b..26cb9df 100644 --- a/src/layouts/sidebar/index.vue +++ b/src/layouts/sidebar/index.vue @@ -102,7 +102,7 @@ export default { width: 160px; height: calc(100vh - 173px); overflow: auto; - transition: .5s; + // transition: .5s; transform: translateX(-200px); &.show { diff --git a/src/pages/achievement/show/index.vue b/src/pages/achievement/show/index.vue index ea3b7df..cb73b26 100644 --- a/src/pages/achievement/show/index.vue +++ b/src/pages/achievement/show/index.vue @@ -201,6 +201,7 @@ export default { }, // 处理实验数据 handleList (list) { + console.log("🚀 ~ handleList ~ list:", list) this.isLc = list.find(e => e.lcRuleRecords) // 流程系统才有lcRuleRecords if (this.isLc) { list.map(e => { diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index 5999d80..c820dea 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -52,20 +52,21 @@

课程

-
- - + + + {{ item.name + }} + + +
+ + + + + + -
@@ -180,20 +181,31 @@ export default { 2: "竞赛" }, isDetail: Boolean(this.$route.query.show), + courseTab: 1, + courseTypes: [ + { + id: 1, + name: '校本课程' + }, + { + id: 0, + name: '我的课程' + }, + ], form: { - id: this.$route.query.id ? this.$route.query.id : "", - experimentalName: "", + id: this.$route.query.id ? this.$route.query.id : '', + experimentalName: '', type: 1, // 发布类型(1、手动发布 2、定时发布) experimentDuration: "0d0h0m", - curriculumId: "", + curriculumId: '', mallId: '', projectId: '', paperId: '', isSpecify: 1, // 考核发布(1、指定范围 0、无指定范围) isEnableCode: 0, //是否设置邀请码 - invitationCode: "", + invitationCode: '', status: 0, // 状态(0、待开始 1、进行中 2、已结束) - classId: "", + classId: '', stuInfo: [] }, date: "", // 实验时间 @@ -206,6 +218,7 @@ export default { stopTime: "0000-00-00 00:00:00", //结束时间 expNameRepeat: false, // 考核名称是否重复 curriculumList: [], // 课程列表 + myCurs: [], filterClassName: "", // 班级名称搜索 tagList: [], // 班级名称标签 defaultCheckedKeys: [], // 默认选中 @@ -254,9 +267,8 @@ export default { }, 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.form.id && this.getData(); - this.recoveryData(); - this.getschoolCourse(); + this.form.id ? this.getData() : this.getMallCourse() + this.recoveryData() }, watch: { // 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 @@ -294,6 +306,19 @@ export default { ...mapActions("project", [ "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) { // 关闭班级标签 this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes()); let tagIndex = this.tagList.findIndex(i => i.id === tag.id); @@ -367,30 +392,43 @@ export default { return resolve([]); } }, - getschoolCourse () { // 获取课程 - this.$get(this.api.getSchoolEffectiveCourse).then(({ data }) => { - this.curriculumList = data; - if (this.curriculumList.length) { - if (!this.form.mallId) this.form.mallId = data[0].mallId - this.getProjectData() - } + async getMallCourse (fromChange) { // 获取校本课程 + const { data } = await this.$get(this.api.getSchoolEffectiveCourse) + this.curriculumList = data + if (this.curriculumList.length) { + if (!this.form.curriculumId || fromChange) this.form.curriculumId = data[0].cid + this.getProjectData() + } + + if (!fromChange) { this.$nextTick(() => { 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 () { - const curItem = this.curriculumList.find(e => e.mallId === this.form.mallId) - let data = { + const cur = this.courseTab ? this.curriculumList.find(e => e.cid === this.form.curriculumId) : {} + this.$post(this.api.getProjectOrExamPaperByAssessment, { pageNum: this.page, pageSize: this.pageSize, - cid: curItem.cid, + cid: this.form.curriculumId, projectName: this.keyword, - systemId: curItem ? curItem.systemId : 1, + systemId: cur ? cur.systemId : '', permissions: 1, - mallId: this.form.mallId - } - this.$post(this.api.getProjectOrExamPaperByAssessment, data).then(({ data }) => { + mallId: cur ? cur.mallId : '' + }).then(({ data }) => { const list = data.records list.forEach(e => { e.uuid = e.projectId || e.paperId // 唯一标识 @@ -420,9 +458,9 @@ export default { 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`; } - if (this.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 (this.form.type == 1) { + if (form.type == 1 && this.form.experimentDuration == "0d0h0m") return Util.warningMsg("请填写考核时长"); + if (form.type == 2 && this.startTime == "0000-00-00 00:00:00") return Util.warningMsg("请填写考核时间"); + if (form.type == 1) { const { day, hour, minute } = this.duration if (String(day).includes('.')) return Util.warningMsg('考核天数请填写整数') if (day < 0) return Util.warningMsg('考核天数请勿填写负数') @@ -434,31 +472,37 @@ export default { if (!form.uuid) return Util.warningMsg("请选择考核项目"); const item = this.projectData.find(e => form.uuid === e.projectId || form.uuid === e.paperId) if (item) form[item.projectId ? 'projectId' : 'paperId'] = form.uuid - if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) { - if (!this.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.isSpecify == 0 && this.form.isEnableCode == 1) { + if (!form.invitationCode) return Util.warningMsg("请设置邀请码") + 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 : '' - this.form.stopTime = this.form.type == 2 ? this.stopTime : '' - let classId = []; - let stuInfo = []; + form.startTime = form.type == 2 ? this.startTime : '' + form.stopTime = form.type == 2 ? this.stopTime : '' + let classId = [] + let stuInfo = [] this.allCheckedNodes.forEach(i => { if (i.level === 3) { - classId.push(i.id); + classId.push(i.id) } 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) { - Util.warningMsg("请选择学生"); - return; + Util.warningMsg("请选择学生") + 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 { - this.form.classId = classId.toString(); - this.form.stuInfo = stuInfo; + form.mallId = '' } - const curItem = this.curriculumList.find(e => e.mallId === this.form.mallId) - this.form.curriculumId = curItem.cid this.submiting = true if (this.form.id) { 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 () { // 格式化实验时长 let duration = this.form.experimentDuration.replace(/\D+/g, ",").split(","); this.duration = { diff --git a/src/pages/lesson/content/index.vue b/src/pages/lesson/content/index.vue index 62053eb..7211632 100644 --- a/src/pages/lesson/content/index.vue +++ b/src/pages/lesson/content/index.vue @@ -400,7 +400,7 @@ export default { message: "上传出错,请重试!", type: "error", center: true - }); + }) }, beforeRemove (file, fileList) { if ((file.size / 1024 / 1024) < 10) { @@ -408,7 +408,7 @@ export default { } }, handleRemove () { - Oss.del(this.fileUrl) + // Oss.del(this.fileUrl) this.fileUrl = '' }, transferType (ext) { @@ -775,8 +775,8 @@ export default { type: "warning" }).then(() => { this.$del(`${this.api.deleteSubsectionCurriculm}/${row.id}`).then(res => { - row.fileUrl && Oss.del(row.fileUrl) - this.$message.success("删除成功") + // row.fileUrl && Oss.del(row.fileUrl) + this.$message.success('删除成功') this.getData() }).catch(res => { }) }).catch(() => { }) diff --git a/src/pages/lesson/content/source.vue b/src/pages/lesson/content/source.vue index 26a6789..0bbb7f0 100644 --- a/src/pages/lesson/content/source.vue +++ b/src/pages/lesson/content/source.vue @@ -174,7 +174,6 @@ export default { methods: { // 初始化 init () { - this.getCourse() this.checked = [] this.curType = '全部' this.sourceType = [ @@ -187,6 +186,7 @@ export default { this.sourceType.forEach(e => { e.check = false }) + this.getCourse() }, // 课程列表 async getCourse () { diff --git a/src/pages/lesson/detail/index.vue b/src/pages/lesson/detail/index.vue index 7067258..505536c 100644 --- a/src/pages/lesson/detail/index.vue +++ b/src/pages/lesson/detail/index.vue @@ -209,7 +209,7 @@
上一步 - 下一步 + 保存并下一步 保存 返回
@@ -837,7 +837,7 @@ export default { cid: this.cid, systemIdByAssessment: list }) - this.step = 4 + this.back() } finally { this.submiting = false load.close() @@ -847,7 +847,7 @@ export default { }, // 跳转步骤 toStep (i) { - this.step = i + if (!this.isAdd || (this.cid && i < this.step)) this.step = i }, // 返回 back () { diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 3de1f0e..9d66af4 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -324,6 +324,7 @@ import quill from "@/components/quill"; import pdfDia from '@/components/pdf' import Editor from '@tinymce/tinymce-vue' import editorConfig from '@/components/editor' +import Cookies from 'js-cookie' export default { components: { pdf, pdfDia, quill, Editor }, 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' : ''}`); } 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)}` } else { // python系统