From ebc36e7376c4ac1999989411f1d2734866c3ada6 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 17 Dec 2024 15:01:52 +0800
Subject: [PATCH] fix
---
src/components/editor.js | 2 +
src/layouts/header/index.vue | 4 +-
src/pages/lesson/content/source.vue | 3 +-
src/pages/lesson/detail/index.vue | 458 ++++++++++++++--------------
src/pages/lesson/list/index.vue | 29 +-
src/styles/common.scss | 5 +
6 files changed, 250 insertions(+), 251 deletions(-)
diff --git a/src/components/editor.js b/src/components/editor.js
index c35f1cf..12167e1 100644
--- a/src/components/editor.js
+++ b/src/components/editor.js
@@ -625,6 +625,8 @@ export default {
ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei")
ed.target.editorCommands.execCommand("fontSize", false, "14px")
ed.target.editorCommands.execCommand("lineHeight", false, "1.5")
+ const el = top.document.querySelector('#focus-el')
+ el && el.focus() // 第一个字段聚焦
})
},
}
\ No newline at end of file
diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue
index 6bb74e9..ba80c96 100644
--- a/src/layouts/header/index.vue
+++ b/src/layouts/header/index.vue
@@ -17,8 +17,8 @@
{{ customerName || userName }}
- 个人中心
- 修改密码
+ 个人中心
+
diff --git a/src/pages/lesson/content/source.vue b/src/pages/lesson/content/source.vue
index ab33339..4abcdf6 100644
--- a/src/pages/lesson/content/source.vue
+++ b/src/pages/lesson/content/source.vue
@@ -62,7 +62,7 @@
-
+
@@ -81,7 +81,6 @@
暂无数据
-
diff --git a/src/pages/lesson/detail/index.vue b/src/pages/lesson/detail/index.vue
index f8f049b..0c853d9 100644
--- a/src/pages/lesson/detail/index.vue
+++ b/src/pages/lesson/detail/index.vue
@@ -216,36 +216,41 @@
-
+
-
-
+
课程系统列表
-
- systemChange(val, item)">
-
-
{{ item.systemName }}
-
+
+
courseChange(val, item)">
+
+ {{ item.label }}
+
+
+
+
+
+
+
systemChange(val, system, item)">
+
+ {{ system.label }}
+
+
+
-
+
项目列表
-
+
checkAllChange(val, projects[0].systemId)">
-
@@ -257,33 +262,33 @@
-
-
-
已选择项目({{ checkeds.length }}个)
-
-
-
-
-
-
-
- {{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }}
-
-
-
-
-
- {{ scope.row.projectName || scope.row.paperName }}
-
-
-
-
-
+
+
+
已选项目(共{{ checkeds.length }}个)
+
批量移除
+
+
+
+
+
+
+
+
+
+
{{ i + 1 }}
+
+ {{ item.projectName }}
+
+
+
+
-
-
+
+
+
+

+
暂无数据
+
@@ -291,7 +296,7 @@
取 消
确 定
-
+
@@ -301,6 +306,7 @@ import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/components/editor'
import Oss from '@/components/upload/upload.js'
+import _ from 'lodash'
export default {
components: {
Editor,
@@ -308,11 +314,8 @@ export default {
data () {
return {
cid: this.$route.query.cid,
- headers: {
- token: sessionStorage.getItem("token")
- },
editorConfig,
- step: 1,
+ step: 2,
form: {
curriculumName: "",
curriculumType: '',
@@ -325,7 +328,6 @@ export default {
teachingObjectives: "",
systemIdByAssessment: [],
systemIdByPractice: [],
- supplier: [],
coverUrl: 'https://izhixinyun.com/images/course-cover.png',
curriculumDisciplines: [
{
@@ -350,9 +352,6 @@ export default {
professionalId: [
{ required: true, message: "请选择专业", trigger: "change" }
],
- supplier: [
- { required: true, message: "请选择供应厂商", trigger: "change" }
- ],
expectedCourse: [
{ required: true, message: "请选择预计课时", trigger: "change" }
],
@@ -364,17 +363,14 @@ export default {
],
},
subjectList: [],
- ProfessionalClassList: [],
- ProfessionalList: [],
pageNo: 1,
pageSize: 10,
multipleSelection: [],
- systemKeyword: "",
searchTimer: null,
configVisible: false,// 配置弹框
- permissions: "", // 练习:0;考核:1
+ permissions: '', // 练习:0;考核:1
practiceData: [],
practiceTotal: 0,
multiplePractice: [],
@@ -387,7 +383,6 @@ export default {
updateTime: 0,
systemAll: [],
systems: [],
- systemsAll: [],
systemChecked: [],
curSystem: '',
projects: [],
@@ -397,17 +392,6 @@ export default {
checkedAll: [],
checkAll: false,
-
- status: [
- {
- id: 0,
- name: '正常'
- }
- ],
- practiceData: [],
- practiceTotal: 0,
- multiplePractice: [],
-
assessmentData: [],
assessmentTotal: 0,
multipleAssessment: [],
@@ -421,54 +405,28 @@ export default {
},
deep: true
},
- systemKeyword: function (val) {
- clearTimeout(this.searchTimer);
- this.searchTimer = setTimeout(() => {
- this.getConfig();
- }, 500);
- },
projectKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
- this.getProject();
- }, 500);
+ this.getProject()
+ }, 500)
},
- checkedKeyword: function (val) {
- clearTimeout(this.searchTimer);
- this.searchTimer = setTimeout(() => {
- this.filterChecked();
- }, 500);
- }
},
created () {
},
mounted () {
this.getSubject()
- this.getConfig()
- this.getSystem()
+ this.getCourseSystem()
this.cid && this.getInfoData()
},
methods: {
getInfoData () {
this.$post(`${this.api.curriculumDetail}?cid=${this.cid}`).then(({ data }) => {
- if (data.supplier) data.supplier = data.supplier.split(',').map(e => +e)
this.form = data
+ this.practiceData = data.practiceConfig
+ this.assessmentData = data.assessmentConfig
this.$nextTick(() => {
- const pList = data.practiceConfig
- const { systemsAll } = this
- pList.map(e => {
- if (!systemsAll.find(n => n.systemId == e.systemId)) e.disabled = true
- })
- this.practiceData = pList
-
- const aList = data.assessmentConfig
- aList.map(e => {
- if (!systemsAll.find(n => n.systemId == e.systemId)) e.disabled = true
- })
- this.assessmentData = aList
-
-
this.form.curriculumDisciplines.forEach(e => {
this.$set(e, 'professionalClassList', [])
this.$set(e, 'professionalList', [])
@@ -478,26 +436,31 @@ export default {
if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '')
if (!e.professionalId) this.$set(e, 'professionalId', '')
})
- });
- }).catch(err => {
- });
- },
- // 获取系统
- getSystem () {
- const checked = this[!this.permissions ?
- 'practiceData' :
- this.permissions == 1 ?
- 'assessmentData' :
- 'matches']
- this.$post(this.api.queryServiceConfig, {
- systemName: '',
- pageNum: 1,
- pageSize: 1000,
- supplierId: ''
- }).then(({ serviceList }) => {
- this.systemsAll = serviceList.records
+ })
}).catch(err => { })
},
+ // 获取课程系统
+ async getCourseSystem () {
+ const res = await this.$get(this.api.getSystemIdBySchool)
+ const systems = res.data
+
+ const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
+ if (systems.length && data.length) {
+ this.cid = [data[0].mallId]
+ data.map(e => {
+ e.id = e.mallId
+ e.label = e.curriculumName
+ e.check = false
+ const children = _.cloneDeep(systems.filter(n => e.systemId.split(',').includes(n.id + ''))) // 筛选出该课程下的系统
+ children.map(n => {
+ n.check = false
+ })
+ e.children = children
+ })
+ this.systems = data
+ // this.getProject(result[0])
+ }
+ },
// 添加学科
addSubject () {
@@ -582,56 +545,12 @@ export default {
this.form.coverUrl = ''
},
- // 获取系统
- getConfig () {
- const checked = this[!this.permissions ?
- 'practiceData' :
- this.permissions == 1 ?
- 'assessmentData' :
- 'matches']
- this.$post(this.api.queryServiceConfig, {
- systemName: this.systemKeyword,
- pageNum: 1,
- pageSize: 1000,
- supplierId: ''
- }).then(res => {
- const list = res.serviceList.records
- this.systemAll = JSON.parse(JSON.stringify(list)) // 全部系统,另外保存
- const result = []
- list.map(e => {
- // 如果选中的项目里有该系统的项目,则隐藏
- // if (!checked.find(n => n.systemId == e.systemId)) {
- // e.check = !!checked.find(n => n.systemId == e.systemId)
- e.check = false
- result.push(e)
- // }
- })
- this.systems = result
- this.checkAll = !!checked.find(n => n.systemId == result[0].systemId) // 因为默认显示第一个系统的项目,所以如果系统默认选中,则全选也勾选上
- result.length && this.getProject(result[0])
- }).catch(err => { })
- },
- // 获取项目列表
- async getProject (item, fromSystemChange) {
- const checked = this.checkeds
- if (item) this.curSystem = item.systemId
- let res
- if (!fromSystemChange) {
- res = await this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${this.curSystem}&keyword=${this.projectKeyword}`)
- }
- const result = []
- const projects = fromSystemChange ? this.projects : res
- projects.map(e => {
- // 如果选择了该项目,则禁用并选中
- const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId))
- e.check = include
- result.push(e)
- })
- this.checkAll = !result.filter(e => !e.check).length
- this.projects = result
+ // 课程选择回调
+ courseChange (val, item) {
+ item.children.map(e => e.check = val)
},
// 系统选择回调
- systemChange (val, item) {
+ async systemChange (val, system, course) {
// 项目列表选中状态同步
const { projects, checkeds } = this
if (projects.length && projects[0].systemId == item.systemId) {
@@ -640,27 +559,55 @@ export default {
})
}
this.projectKeyword = ''
- this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}&keyword=${this.projectKeyword}`).then(res => {
+ const { data } = await this.$post(this.api.queryProjectManage, {
+ projectName: this.projectKeyword,
+ platformId: 1,
+ founder: 2,
+ permissions: this.permissions,
+ cid: course.cid,
+ mallId: course.mallId,
+ systemId: system.id,
+ pageNum: 1,
+ pageSize: 1000,
+ })
+ const list = data.records
+ list.forEach(e => {
+ e.check = val
+ const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))
if (val) {
- // 如果不支持多选系统,选中后全部取消选中再选中当前系统
- if (!this.mulSystem) {
- this.systems.map(e => e.check = false)
- item.check = true
- }
- res.map(e => {
- if (!checkeds.find(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))) {
- checkeds.push(e)
- }
- })
- } else {
- res.map(e => {
- const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))
- i === -1 || checkeds.splice(i, 1)
- })
+ i === -1 && checkeds.push(e)
+ } else if (i !== -1) {
+ checkeds.splice(i, 1)
}
- this.checkedAll = JSON.parse(JSON.stringify(checkeds)) // 全部已选项目,另外保存
- this.getProject(item, 1)
- }).catch(err => { })
+ })
+ this.checkedAll = _.cloneDeep(checkeds) // 全部已选项目,另外保存
+ },
+ // 获取项目列表
+ async getProject (item, fromSystemChange) {
+ const checked = this.checkeds
+ if (item) this.curSystem = item.systemId
+
+ const { data } = await this.$post(this.api.queryProjectManage, {
+ projectName: this.projectKeyword,
+ platformId: 1,
+ founder: 2,
+ permissions: this.permissions,
+ cid: item.cid,
+ mallId: item.mallId,
+ systemId: item.children.map(e => e.id).join(),
+ pageNum: 1,
+ pageSize: 1000,
+ })
+ // const result = []
+ // const projects = fromSystemChange ? this.projects : res
+ // projects.map(e => {
+ // // 如果选择了该项目,则禁用并选中
+ // const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId))
+ // e.check = include
+ // result.push(e)
+ // })
+ // this.checkAll = !result.filter(e => !e.check).length
+ // this.projects = result
},
// 项目全选回调
checkAllChange (val, systemId) {
@@ -675,7 +622,7 @@ export default {
const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId))
// 选中,则push,否则移除
if (val) {
- this.checkeds.push(item)
+ i === -1 && this.checkeds.push(item)
} else if (i !== -1) {
this.checkeds.splice(i, 1)
}
@@ -686,11 +633,6 @@ export default {
this.checkAll = !this.projects.find(e => !e.check) // 同步全选框
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // 全部已选项目,另外保存
},
- // 已选择项目模糊查询
- filterChecked () {
- const val = this.checkedKeyword
- this.checkeds = this.checkedAll.filter(e => (e.projectName && e.projectName.includes(val)) || (e.paperName && e.paperName.includes(val)))
- },
// 删除已选项目
delProject (i, e) {
if (e.disabled) return
@@ -730,9 +672,6 @@ export default {
} else if (this.permissions == 1) {
this.assessmentData = JSON.parse(JSON.stringify(list))
this.assessmentTotal = this.assessmentData.length;
- } else if (this.permissions == 2) {
- this.matches = JSON.parse(JSON.stringify(list))
- this.matchTotal = this.matches.length;
}
}
},
@@ -745,13 +684,11 @@ export default {
// 练习考核弹框
handleConfig (type) {
- this.systemKeyword = ''
this.projectKeyword = ''
this.checkedKeyword = ''
this.permissions = type;
this.configVisible = true;
- this.pageNo = 1;
- this.getConfig();
+ this.pageNo = 1
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData))
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds))
},
@@ -828,7 +765,6 @@ export default {
if (valid) {
if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form))
- form.supplier = form.supplier.join()
form.platformId = Setting.platformId
this.submiting = true
this.loadIns = this.$loading({
@@ -1082,27 +1018,65 @@ export default {
}
/deep/.config-dia {
- .config-wrap {
+ .el-drawer__header {
+ padding-bottom: 20px;
+ margin-bottom: 0;
+ border-bottom: 1px solid #eee;
+ }
+
+
+ .none {
display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ font-size: 14px;
+ text-align: center;
+ color: #a3a3a3;
}
- .title-wrap {
+ .p-title {
margin-bottom: 15px;
}
+ .config-wrap {
+ display: flex;
+ padding: 15px;
+ }
+
.item {
- width: 250px;
- max-height: 600px;
+ width: 350px;
+ height: calc(100vh - 93px);
padding: 10px;
margin-right: 20px;
overflow: hidden;
+
+ &.project {
+ border-right: 1px solid #eee;
+ }
}
.system {
+ width: 350px;
background-color: #f9f9f9;
}
.systems {
+ max-height: calc(100vh - 133px);
+ margin-top: 10px;
+ overflow: auto;
+
+ .line {
+ &>.name {
+ span {
+ max-width: 280px;
+ }
+ }
+ }
+ }
+
+ .projects {
margin-top: 10px;
max-height: 520px;
overflow: auto;
@@ -1112,25 +1086,35 @@ export default {
align-items: center;
margin: 10px 0;
}
+ }
+
+ .name {
+ display: inline-flex;
+ flex: 1;
+ justify-content: space-between;
+ align-items: center;
+ margin-left: 5px;
+ cursor: pointer;
+
+ &.active,
+ &:hover {
+ color: #062c87;
+ }
- .name {
- display: inline-flex;
- flex: 1;
- justify-content: space-between;
- align-items: center;
- margin-left: 5px;
- cursor: pointer;
+ span {
+ max-width: 200px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+ }
- &.active,
- &:hover {
- color: #062c87;
- }
+ .children {
+ padding-left: 20px;
+ .name {
span {
- max-width: 200px;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
+ max-width: 265px !important;
}
}
}
@@ -1138,24 +1122,42 @@ export default {
.checked {
flex: 1;
width: auto;
+ }
- .el-table .cell {
- font-size: 12px;
- }
+ .lines {
+ height: calc(100vh - 228px);
+ padding-right: 10px;
+ margin-top: 10px;
+ overflow: auto;
}
- .rm {
- font-size: 14px;
- cursor: pointer;
+ .line {
+ display: flex;
+ align-items: center;
+ padding: 5px 0;
+ color: #333;
+ }
- &.disabled {
- color: #ccc;
- cursor: not-allowed;
- }
+ .serial {
+ width: 32px;
+ margin: 0 12px;
+ text-align: center;
+ white-space: nowrap;
+ }
- &:hover {
- color: #17161f;
- }
+ .check-left {
+ display: inline-flex;
+ align-items: center;
+ }
+
+ .checked-name {
+ width: 360px;
+ margin-right: 20px;
+ }
+
+ .action-icon {
+ font-size: 14px;
+ cursor: pointer;
}
}
\ No newline at end of file
diff --git a/src/pages/lesson/list/index.vue b/src/pages/lesson/list/index.vue
index 70c3d10..38edc2f 100644
--- a/src/pages/lesson/list/index.vue
+++ b/src/pages/lesson/list/index.vue
@@ -44,8 +44,8 @@
-
+
@@ -65,7 +65,7 @@
+ @selection-change="handleSelectionChange" row-key="cid">
@@ -146,9 +146,6 @@ export default {
this.getData();
},
methods: {
- getRowKeys (row) {
- return row.cid;
- },
// 获取列表数据
getData () {
this.$post(this.api.curriculumList, {
@@ -274,27 +271,21 @@ export default {
}
}).catch(err => { })
} else {
- this.$message.warning("请先选择课程 !");
+ this.$message.warning("请先选择课程 !")
}
},
// 处理页码切换
handleCurrentChange (val) {
- this.page = val;
- this.$router.push(`/curriculum?page=${val}`)
- this.getData();
- },
- // 课程名称条件搜索
- onSearch () {
- this.page = 1;
- this.getData();
+ this.page = val
+ this.$router.push(`list?page=${val}`)
+ this.getData()
},
// 上下架
changeSwitch (value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => {
- this.getData();
- this.$message.success("修改上下架状态成功!");
- }).catch((res) => {
- });
+ this.getData()
+ this.$message.success("修改上下架状态成功!")
+ }).catch((res) => { })
}
}
};
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 579875d..fe9513f 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -389,4 +389,9 @@
position: fixed;
top: 0;
left: 0;
+}
+.el-drawer__header > :first-child {
+ font-size: 16px;
+ font-weight: 600;
+ color: #333;
}
\ No newline at end of file