From 7887d2824364089a936e5bf0f799dfb5ef62ad2e Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 21 Apr 2023 14:50:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 + src/pages/assessment/list/index.vue | 33 +----- src/pages/station/list/index.vue | 149 +++++++++++++++++++--------- src/pages/station/preview/index.vue | 5 + src/setting.js | 2 +- 5 files changed, 110 insertions(+), 81 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 1744873..7268f87 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -22,6 +22,8 @@ export default { getProjectBySystemId: 'occupationlab/occupationlab/projectManage/getProjectBySystemId', getTheMostRecentlyRunProject: 'python/python/getTheMostRecentlyRunProject', whetherToRenewTheFee: 'nakadai/nakadai/curriculum/whetherToRenewTheFee', + recentUse: `nakadai/nakadai/curriculum/recentUse`, + recordRecentUsage: `nakadai/nakadai/curriculum/recordRecentUsage`, // 权限管理 getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`, diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue index a7445fa..7027242 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -115,14 +115,6 @@ - - - -
-

该课程订阅期限已到期,请联系院校管理员续费

- -
-
@@ -195,7 +187,6 @@ export default { multipleSelection: [], // 多选 listLoading:false,// 列表加载 ticker: null, // 倒计时定时器 - buyVisible: false }; }, computed: { @@ -329,32 +320,22 @@ export default { console.log(err); }); }, - // 查询是否过期 - async getStatus(cid) { - const res = await this.$get(this.api.whetherToRenewTheFee, { - cid - }) - this.buyVisible = !res.isRenew - // 1正常显示资源,0显示续费 - return res.isRenew - }, add() { this.$router.push("add"); }, edit(row) { - this.getStatus(row.curriculumId) && this.$router.push(`add?id=${row.id}`); + this.$router.push(`add?id=${row.id}`); }, show(row) { this.$router.push(`/achievement/teach?id=${row.id}&projectName=${row.projectName}&permissions=1`) }, start(row) { - this.getStatus(row.curriculumId) && this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => { util.successMsg("启动成功!"); this.getData(1); }).catch(err => { console.log(err); - }) + }); }, finish(row) { this.$confirm("确定要提前结束吗?", "提示", { @@ -434,14 +415,4 @@ export default { .el-radio.is-bordered + .el-radio.is-bordered { margin-left: 0; } -.buy { - text-align: center; - .tips { - margin-bottom: 10px; - font-size: 14px; - } - img { - width: 85%; - } -} \ No newline at end of file diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index ef15d84..8e0b5d0 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -9,7 +9,11 @@
-
+
+ +
-
-
- -

暂无数据

-
+
+
+ +

暂无数据

+
+
@@ -38,6 +43,17 @@ export default { data() { return { keyword: "", + active: 0, + tabs: [ + { + id: 0, + name: '实验课程' + }, + { + id: 1, + name: '最近使用' + } + ], curriculumList: [] } }, @@ -46,6 +62,13 @@ export default { }, methods: { getschoolCourse() { // 获取课程列表 + this.active ? + this.$post(this.api.recentUse, { + pageNum: 1, + pageSize: 100 + }).then(({ page }) => { + this.curriculumList = page.records + }).catch(err => {}) : this.$get(this.api.schoolCourse).then(res => { this.curriculumList = res.data; }).catch(err => { @@ -55,6 +78,11 @@ export default { goPreview(item) { this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.curriculumName}`); }, + // tab切换 + tabChange(item) { + this.active = item.id + this.getschoolCourse() + }, } }; @@ -96,60 +124,83 @@ export default { } } +.tab { + display: flex; + justify-content: center; + align-items: center; + .item { + padding: 0 20px; + margin-right: 16px; + font-size: 17px; + text-align: center; + color: #333; + line-height: 50px; + border-bottom: 3px solid transparent; + cursor: pointer; + &.active { + color: #007EFF; + border-color: #007EFF; + } + } +} .station { min-height: calc(100vh - 520px); background: url(../../../assets/img/station1.png) (top left)/auto no-repeat, url(../../../assets/img/station2.png) bottom right/auto no-repeat; .inner { + width: 1072px; + margin: 0 auto; + } + .curs { display: flex; flex-wrap: wrap; width: 1072px; padding-top: 60px; margin: 0 auto; - } - .item { - position: relative; - padding: 0 10px; - margin: 0 10px 40px; - text-align: center; - background-color: #fff; - border-radius: 8px; - cursor: pointer; - &:hover { - opacity: .9; - } - img { - width: 215px; - height: 118px; - margin-top: -20px; - border-radius: 12px; - } - .bottom { - display: flex; - justify-content: space-between; - align-items: center; - padding: 10px 5px; - } - .text { - display: inline-flex; - align-items: center; - width: 130px; - height: 40px; - text-align: left; - font-size: 12px; - line-height: 1.6; - overflow: hidden; - span { - @include mul-ellipsis(2); + .item { + position: relative; + padding: 0 10px; + margin: 0 10px 40px; + text-align: center; + background-color: #fff; + border-radius: 8px; + cursor: pointer; + &:hover { + opacity: .9; + } + img { + width: 215px; + height: 118px; + margin-top: -20px; + border-radius: 12px; + } + .bottom { + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px 5px; + } + .text { + display: inline-flex; + align-items: center; + width: 130px; + height: 40px; + text-align: left; + font-size: 12px; + line-height: 1.6; + overflow: hidden; + span { + @include mul-ellipsis(2); + } + } + a { + padding: 0 8px; + line-height: 28px; + font-size: 14px; + color: #7A7A7A; + border-radius: 20px; + border: 1px solid #DADADA; } - } - a { - padding: 0 8px; - line-height: 28px; - font-size: 14px; - color: #7A7A7A; - border-radius: 20px; - border: 1px solid #DADADA; } } } diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index ec7b008..f57db5c 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -166,6 +166,7 @@ export default { this.insertScript(); this.getData(); this.getStatus() + this.addRecord() }, methods: { goBack() { @@ -180,6 +181,10 @@ export default { this.assessmentList = data.assessmentConfig; this.systemIds = data.systemIds }, + // 记录最近使用 + addRecord() { + this.$post(`${this.api.recordRecentUsage}?cid=${this.courseId}`).then(res => {}).catch(res => {}) + }, // 查询是否过期 getStatus() { this.$get(this.api.whetherToRenewTheFee, { diff --git a/src/setting.js b/src/setting.js index 0fbbd78..41f846d 100644 --- a/src/setting.js +++ b/src/setting.js @@ -26,7 +26,7 @@ if (isPro) { uploadURL = `http://121.37.12.51/` host = "http://121.37.12.51/"; // 中台测试服 // host = 'https://www.occupationlab.com/' // 正式服 - // host = "http://192.168.31.151:9000/"; // 榕 + host = "http://192.168.31.151:9000/"; // 榕 // host = 'http://192.168.31.116:9000/'; // 赓 }