+
+
@@ -21,7 +29,7 @@
{{ item.goodsName || item.curriculumName }}
-
续费
+
续费
进入实验
@@ -56,10 +64,34 @@ export default {
isZj: location.host === '10.60.32.76', // 浙江万里
isSq: Setting.isSq,
keyword: this.$route.query.keyword || '',
- active: +this.$route.query.active || 0,
+ typeActive: +this.$route.query.typeActive || 0,
+ active: +this.$route.query.active || '',
searchTimer: null,
+ types: [
+ {
+ id: 0,
+ name: '校本课程'
+ },
+ {
+ id: 1,
+ name: '我的课程'
+ },
+ ],
+ defaultTypes: [],
+ selfBuildCourseType: [],
+ defaultTabs: [
+ {
+ classificationId: '',
+ classificationName: '全部',
+ },
+ {
+ classificationId: -1,
+ classificationName: '最近使用',
+ },
+ ],
tabs: [],
products: [],
+ loading: false,
linkVisible: false,
links: [],
@@ -77,36 +109,44 @@ export default {
methods: {
// 获取tab
async getTab () {
- const { data } = await this.$get(this.api.getSchoolCourseAuthority)
+ const res = await this.$get(this.api.getSchoolCourseAuthority)
+ this.defaultTypes = res.data
+ this.selfBuildCourseType = res.selfBuildCourseType
this.tabs = [
- {
- classificationId: 0,
- classificationName: '最近使用',
- },
- {
- classificationId: -1,
- classificationName: '全部',
- },
- ...data,
+ ...this.defaultTabs,
+ ...res.data,
]
this.getList()
},
// 获取课程列表
async getList () {
+ this.loading = true
// 最近使用
- if (this.active === 0) {
- const { page } = await this.$post(this.api.recentUse, {
- pageNum: 1,
- pageSize: 100,
+ if (this.active === -1) {
+ const { list } = await this.$post(this.api.recentUse, {
+ courseType: this.typeActive,
goodsName: this.keyword,
})
- this.products = page.records
+ this.products = list
+ this.loading = false
} else {
- const { data } = await this.$get(this.api.schoolCourse, {
- authority: this.active === -1 ? '' : this.active,
- goodsName: this.keyword,
- })
- this.products = data
+ if (this.typeActive) {
+ // 我的课程
+ const res = await this.$post(this.api.selfBuildCourse, {
+ curriculumType: this.active,
+ curriculumName: this.keyword,
+ })
+ this.products = res.courses
+ this.loading = false
+ } else {
+ // 校本课程
+ const { data } = await this.$get(this.api.schoolCourse, {
+ authority: this.active,
+ goodsName: this.keyword,
+ })
+ this.products = data
+ this.loading = false
+ }
}
},
// 记录最近使用
@@ -114,32 +154,46 @@ export default {
await this.$post(`${this.api.recordRecentUsage}?mallId=${mallId}`)
},
toProduct (item) {
- const params = `&keyword=${this.keyword}&active=${this.active}`
- const links = item.nonAssociatedLinks
- // 已过期 / 没有cid并且没有链接,则跳转到产品详情
- if (!item.isInEffect) {
- this.$router.push(`/product/show?id=${item.mallId}${params}`)
- } else if (item.isInEffect && !item.cid && !links) {
- this.addRecord(item.mallId)
- this.$router.push(`/product/show?id=${item.mallId}${params}`)
+ const params = `&keyword=${this.keyword}&active=${this.active}&typeActive=${this.typeActive}`
+ if (this.typeActive) {
+ this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.curriculumName)}&mallId=${item.mallId || ''}${params}`)
} else {
- // 有链接
- if (links && links.length) {
- if (links.length === 1) {
- this.addRecord(item.mallId)
- window.open(links[0].url)
+ const links = item.nonAssociatedLinks
+ // 已过期 / 没有cid并且没有链接,则跳转到产品详情
+ if (!item.isInEffect) {
+ this.$router.push(`/product/show?id=${item.mallId}${params}`)
+ } else if (item.isInEffect && !item.cid && !links) {
+ this.addRecord(item.mallId)
+ this.$router.push(`/product/show?id=${item.mallId}${params}`)
+ } else {
+ // 有链接
+ if (links && links.length) {
+ if (links.length === 1) {
+ this.addRecord(item.mallId)
+ window.open(links[0].url)
+ } else {
+ this.addRecord(item.mallId)
+ this.linkVisible = true
+ this.links = item.nonAssociatedLinks
+ }
} else {
- this.addRecord(item.mallId)
- this.linkVisible = true
- this.links = item.nonAssociatedLinks
+ this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.goodsName)}&mallId=${item.mallId || ''}${params}`)
}
- } else {
- this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.goodsName)}&mallId=${item.mallId || ''}${params}`)
}
}
},
// tab切换
- tabChange (item) {
+ tabChange ({ id }) {
+ this.typeActive = id
+ this.tabs = [
+ ...this.defaultTabs,
+ ...this[id ? 'selfBuildCourseType' : 'defaultTypes'],
+ ]
+ if (this.active !== '' && this.active !== -1) this.active = ''
+ this.getList()
+ },
+ // tab切换
+ tab1Change (item) {
this.active = item.classificationId
this.getList()
},
@@ -200,7 +254,7 @@ export default {
font-size: 17px;
text-align: center;
color: #333;
- line-height: 50px;
+ line-height: 44px;
border-bottom: 3px solid transparent;
cursor: pointer;
@@ -211,6 +265,41 @@ export default {
}
}
+.tab-wrap {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-top: 20px;
+
+ .label {
+ margin-right: 20px;
+ font-size: 16px;
+ font-weight: 600;
+ }
+
+ .tabs1 {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .item {
+ padding: 0 15px;
+ margin-right: 16px;
+ font-size: 16px;
+ text-align: center;
+ color: #333;
+ line-height: 40px;
+ border-radius: 2px;
+ cursor: pointer;
+
+ &.active {
+ color: #fff;
+ background-color: $main-color;
+ }
+ }
+ }
+}
+
.station {
min-height: calc(100vh - 520px);
background: url(../../../assets/img/station1.png) (top left) / auto no-repeat,
diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue
index 87cb5e7..c84c6aa 100644
--- a/src/pages/station/preview/index.vue
+++ b/src/pages/station/preview/index.vue
@@ -51,7 +51,8 @@
- 续费
+ 续费
进入理论
进入实训
@@ -449,7 +450,7 @@ export default {
const { query } = this.$route
this.fromAdmin ?
this.$router.back() :
- this.mallId ? this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}`) : this.$router.back()
+ (this.mallId || query.typeActive) ? this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}&typeActive=${query.typeActive || 0}`) : this.$router.back()
},
init () {
this.insertScript()
@@ -473,7 +474,7 @@ export default {
},
// 记录最近使用
async addRecord () {
- await this.$post(`${this.api.recordRecentUsage}?mallId=${this.mallId}`)
+ await this.$post(`${this.api.recordRecentUsage}?mallId=${this.mallId}&cid=${this.courseId}`)
},
// 查询是否过期
async getStatus () {
@@ -483,9 +484,9 @@ export default {
})
// 1正常显示资源,0显示续费,-1试用
this.overdue = isRenew
- this.getProgress()
}
this.getChapter()
+ this.getProgress()
},
// 获取章节小节
async getChapter () {
diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue
index b8fa70d..9580b53 100644
--- a/src/pages/student/list/index.vue
+++ b/src/pages/student/list/index.vue
@@ -16,7 +16,7 @@
学生组织架构
- 添加
+ 添加
@@ -27,11 +27,11 @@
{{ node.label }}
- handleEdit(node, data)">
- handleAdd(node, data)">
+ handleAdd(node, data)">
@@ -71,9 +71,9 @@
一键批量生成账号
- 新增学生
- 批量导入
- 批量删除
+ 新增学生
+ 批量导入
+ 批量删除
@@ -95,12 +95,13 @@
- 移除
- 查看
- 编辑
- 重置密码
- 删除
- 移除
+ 查看
+ 编辑
+ 重置密码
+ 删除
+
@@ -148,7 +149,7 @@
{{ node.label }}
- handleAdd(node, data)">
diff --git a/src/pages/system/list/role.vue b/src/pages/system/list/role.vue
index fc85311..50f2856 100644
--- a/src/pages/system/list/role.vue
+++ b/src/pages/system/list/role.vue
@@ -8,8 +8,8 @@
- 新增角色
- 批量删除
+ 新增角色
+ 批量删除
@@ -27,11 +27,13 @@
- 查看
+ 查看
- 编辑
- 删除
+ 编辑
+ 删除
diff --git a/src/pages/system/list/staff.vue b/src/pages/system/list/staff.vue
index 4133121..accf7e4 100644
--- a/src/pages/system/list/staff.vue
+++ b/src/pages/system/list/staff.vue
@@ -14,9 +14,9 @@
一键批量生成账号
- 新增教师
- 批量导入
- 批量删除
+ 新增教师
+ 批量导入
+ 批量删除
diff --git a/src/pages/workbench/list/index.vue b/src/pages/workbench/list/index.vue
index 191be8f..e0cc8f4 100644
--- a/src/pages/workbench/list/index.vue
+++ b/src/pages/workbench/list/index.vue
@@ -3,31 +3,31 @@