diff --git a/src/api/index.js b/src/api/index.js index e420000..ab03d77 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -12,6 +12,8 @@ export default { getUserAllRoleByToken : `users/role/getUserAllRoleByToken`, getSchoolIdByToken : `users/users/data/user/getSchoolIdByToken`, + platformLogList: `nakadai/log/platformLogList`, + logNotification: `nakadai/log/logNotification`, //实验台 curriculumDetail: `nakadai/nakadai/curriculum/curriculumDetail`, // 课程详情 curriculumChapter: `nakadai/curriculum/chapter/queryChaptersAndSubsections`, // 根据课程id查询章节小节,树状结构 diff --git a/src/assets/img/bug.png b/src/assets/img/bug.png new file mode 100644 index 0000000..3c9c4a6 Binary files /dev/null and b/src/assets/img/bug.png differ diff --git a/src/assets/img/func.png b/src/assets/img/func.png new file mode 100644 index 0000000..d838c29 Binary files /dev/null and b/src/assets/img/func.png differ diff --git a/src/assets/img/log-bg.png b/src/assets/img/log-bg.png new file mode 100644 index 0000000..f6de30e Binary files /dev/null and b/src/assets/img/log-bg.png differ diff --git a/src/assets/img/log-bg1.png b/src/assets/img/log-bg1.png new file mode 100644 index 0000000..2bdcaca Binary files /dev/null and b/src/assets/img/log-bg1.png differ diff --git a/src/assets/img/optimize.png b/src/assets/img/optimize.png new file mode 100644 index 0000000..e086e21 Binary files /dev/null and b/src/assets/img/optimize.png differ diff --git a/src/layouts/home/index.vue b/src/layouts/home/index.vue index f31850c..50baf58 100644 --- a/src/layouts/home/index.vue +++ b/src/layouts/home/index.vue @@ -10,6 +10,31 @@ +
+
+ + +

更新日志

+
+
+
+
{{ item.versionName }}
+ +
    +
  • +

    {{ funcList.find(e => e.id === item.type).name }}

    +
    +

    {{ i + 1 }}、{{ item }}

    +
    +
  • +
+
+
+
+ 知道了 +
+
+
@@ -18,26 +43,79 @@ import vHead from "../header"; import navbar from "../navbar"; import vFooter from "../footer"; -import { mapState, mapActions } from "vuex"; +import { mapState, mapMutations, mapActions } from "vuex"; import util from "@/libs/util"; import Setting from "@/setting"; export default { data() { - return {}; + return { + logVisible: false, + list: [], + logAll: false, + funcList: [ + { + id: 0, + name: '新功能', + icon: 'func' + }, + { + id: 1, + name: '修复', + icon: 'bug' + }, + { + id: 2, + name: '优化', + icon: 'optimize' + } + ] + }; }, components: { vHead, navbar, vFooter }, + computed: { + ...mapState("user", [ + 'logView' + ]) + }, mounted() { this.autoLogout(); + this.logView || this.getLogStatus() // logView为false才需要查询接口 }, methods: { + ...mapMutations("user", [ + 'SET_LOG' + ]), ...mapActions("user", [ "logout" ]), + // 获取日志列表 + getLog() { + this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => { + logList.map((e, i) => { + e.logContents.map(n => { + n.content = n.content.split('\n') + }) + }) + this.list = logList + }).catch(res => {}) + }, + // 获取日志状态 + getLogStatus() { + util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, { + platformId: Setting.platformId + }).then(({ notification }) => { + this.SET_LOG() // 把查看日志状态设置为true + if (notification) { + this.logVisible = true // 返回true,则显示日志弹框 + this.getLog() + } + }).catch(res => {}) + }, // 长时间未操作,自动退出登录 autoLogout() { let lastTime = new Date().getTime(); @@ -63,5 +141,97 @@ export default { min-height: calc(100vh - 176px); padding: 24px 24px; } +}.log-mask { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + background-color: rgba(0, 0, 0, .4); +} +/deep/.log-dia { + z-index: 11; + position: absolute; + top: 250px; + left: 50%; + width: 550px; + transform: translateX(-50%); + background-color: #fff; + border-radius: 6px; + .bg1 { + width: 100%; + height: 140px; + } + .bg2 { + position: absolute; + top: -130px; + left: 48px; + max-width: 100%; + height: 250px; + } + .log-title { + position: absolute; + top: 65px; + left: 0; + width: 100%; + text-align: center; + font-size: 22px; + color: #fff; + font-weight: 600; + } + .log-wrap { + padding-bottom: 30px; + } + .logs { + max-height: 250px; + padding: 0 100px; + margin: 30px 0; + overflow: auto; + } + h6 { + margin-bottom: 15px; + font-size: 16px; + color: #333; + line-height: 1; + } + .more-wrap { + padding: 0 60px; + font-size: 14px; + color: #333; + text-align: center; + } + .know { + margin-top: 15px; + } + .cover { + max-width: 250px; + max-height: 160px; + margin: 10px 0 20px; + } + .detail { + li { + margin-bottom: 20px; + } + .name { + display: flex; + align-items: center; + margin-bottom: 5px; + font-size: 14px; + img { + width: 20px; + margin-right: 8px; + } + } + .val { + font-size: 15px; + line-height: 1.8; + white-space: pre-wrap; + p { + position: relative; + font-size: 13px; + color: #727272; + } + } + } } \ No newline at end of file diff --git a/src/pages/achievement/teach/index.vue b/src/pages/achievement/teach/index.vue index 3ef1f41..6abd9aa 100644 --- a/src/pages/achievement/teach/index.vue +++ b/src/pages/achievement/teach/index.vue @@ -148,7 +148,7 @@ export default { this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`).then(res => { this.listDataAll = res.page.records this.total = res.page.total - this.avgScore = res.avgScore + this.avgScore = (+res.avgScore).toFixed(2) this.peopleNum = res.peopleNum this.handlePage() this.getChart() @@ -158,8 +158,7 @@ export default { this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyword=${this.keyword}`).then(res => { this.listDataAll = res.page.records this.total = res.page.total - let avgScore = +res.avgScore - this.avgScore = avgScore.toFixed(2) + this.avgScore = (+res.avgScore).toFixed(2) this.peopleNum = res.peopleNum this.handlePage() this.getChart() diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index f4fc7a7..1eef8e2 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -5,7 +5,7 @@
- {{ form.id ? "更新" : "创建" }} + {{ form.id ? "更新" : "创建" }}
@@ -39,11 +39,11 @@
实验时长: - + 天 - + 小时 - +
@@ -255,7 +255,8 @@ export default { total: 0, isToProject: false, systemList: [], - submiting: false // 新增编辑防抖标识 + submiting: false, // 新增编辑防抖标识 + updateTime: 0 }; }, computed: { @@ -273,6 +274,13 @@ export default { if (!this.isToProject) this.setAss({}); }, watch: { + // 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 + form: { + handler(val){ + this.updateTime++ + }, + deep:true + }, date: function(val) { if (val[0] != "0000-00-00 00:00:00") { this.startTime = util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(val[0])); @@ -420,7 +428,7 @@ export default { this.page = 1; this.getProjectData(); }, - upload() { // 提交 + submit() { // 提交 if (this.submiting) return false if (!this.form.experimentalName) return util.warningMsg("请填写考核名称"); if (this.expNameRepeat) return util.warningMsg("考核名称重复,请重新输入"); @@ -435,17 +443,19 @@ export default { 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) { - const duration = this.duration - if (String(duration.day).includes('.')) return util.warningMsg('实验天数请填写整数') - if (String(duration.hour).includes('.')) return util.warningMsg('实验小时请填写整数') - if (String(duration.minute).includes('.')) return util.warningMsg('实验分钟请填写整数') + const { day, hour, minute } = this.duration + if (String(day).includes('.')) return util.warningMsg('实验天数请填写整数') + if (day < 0) return util.warningMsg('实验天数请勿填写负数') + if (String(hour).includes('.')) return util.warningMsg('实验小时请填写整数') + if (hour < 0) return util.warningMsg('实验小时请勿填写负数') + if (String(minute).includes('.')) return util.warningMsg('实验分钟请填写整数') + if (minute < 0) return util.warningMsg('实验分钟请勿填写负数') } if (!this.form.projectId) return util.warningMsg("请选择实训项目"); 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位纯数字邀请码"); } - debugger if (this.form.type == 2) { this.form.startTime = this.startTime; this.form.stopTime = this.stopTime; @@ -549,14 +559,25 @@ export default { this.page = val; this.getProjectData(); }, + // 返回上一页 + backPage() { + this.$router.back() + }, goBack() { - if (this.isDetail) { - this.$router.back(); - } else { - this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { type: "warning" }).then(() => { - this.$router.back(); - }); - } + const { id } = this.form + const updateTime = this.updateTime + // 更改了信息才需要提示 + if (updateTime > 1) { + this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { + type: 'warning' + }).then(() => { + this.submit() + }).catch(() => { + this.backPage() + }) + } else { + this.backPage() + } } } }; diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 179a2bf..7547c01 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -326,7 +326,6 @@ $height: 700px; .video_wid,.cover{ position: relative; width: 76%; - max-width: 1400px; height: $height !important; border: 0; } diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index 35fd188..76fe3fd 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -1,6 +1,6 @@