dev_202412
yujialong 2 months ago
parent 78a7ecd845
commit ebc36e7376
  1. 2
      src/components/editor.js
  2. 4
      src/layouts/header/index.vue
  3. 3
      src/pages/lesson/content/source.vue
  4. 458
      src/pages/lesson/detail/index.vue
  5. 29
      src/pages/lesson/list/index.vue
  6. 5
      src/styles/common.scss

@ -625,6 +625,8 @@ export default {
ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei")
ed.target.editorCommands.execCommand("fontSize", false, "14px") ed.target.editorCommands.execCommand("fontSize", false, "14px")
ed.target.editorCommands.execCommand("lineHeight", false, "1.5") ed.target.editorCommands.execCommand("lineHeight", false, "1.5")
const el = top.document.querySelector('#focus-el')
el && el.focus() // 第一个字段聚焦
}) })
}, },
} }

@ -17,8 +17,8 @@
<span class="m-l-10">{{ customerName || userName }}</span> <span class="m-l-10">{{ customerName || userName }}</span>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="!customerName" command="person">个人中心</el-dropdown-item> <el-dropdown-item command="person">个人中心</el-dropdown-item>
<el-dropdown-item v-else command="resetPw">修改密码</el-dropdown-item> <!-- <el-dropdown-item v-else command="resetPw">修改密码</el-dropdown-item> -->
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>

@ -62,7 +62,7 @@
<el-input placeholder="请输入资源名称" prefix-icon="el-icon-search" v-model="checkedKeyword" clearable></el-input> <el-input placeholder="请输入资源名称" prefix-icon="el-icon-search" v-model="checkedKeyword" clearable></el-input>
<div :class="['lines']"> <div class="lines">
<template v-for="(item, i) in checked"> <template v-for="(item, i) in checked">
<div v-if="item.name.includes(checkedKeyword)" :key="i" class="line"> <div v-if="item.name.includes(checkedKeyword)" :key="i" class="line">
<div class="check-left"> <div class="check-left">
@ -81,7 +81,6 @@
<img class="icon" src="@/assets/img/empty.svg" alt=""> <img class="icon" src="@/assets/img/empty.svg" alt="">
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
</div> </div>
</div> </div>

@ -216,36 +216,41 @@
</div> </div>
<!-- 配置弹窗 --> <!-- 配置弹窗 -->
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia"> <el-drawer title="添加系统资源" :visible.sync="configVisible" size="1200px" :close-on-click-modal="false"
custom-class="config-dia">
<div class="config-wrap"> <div class="config-wrap">
<div class="item system"> <div class="item system">
<div class="title-wrap flex-center"> <h6 class="p-title" style="margin-bottom: 0;">课程系统列表</h6>
<p class="addhr_tag"></p>
<span>系统列表</span>
</div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword"
clearable></el-input>
<ul class="systems"> <ul class="systems">
<li v-for="(item, i) in systems" :key="i" :title="item.systemName"> <li v-for="(item, i) in systems" :key="i" :title="item.systemName">
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox> <div class="line">
<div :class="['name', { active: curSystem == item.systemId }]" @click="getProject(item)"> <el-checkbox v-model="item.check" @change="val => courseChange(val, item)"></el-checkbox>
<span>{{ item.systemName }}</span> <div :class="['name', { active: curSystem == item.id }]" @click="getProject(item)">
<i class="el-icon-arrow-right"></i> <span>{{ item.label }}</span>
<i class="el-icon-arrow-right"></i>
</div>
</div>
<div class="children">
<div v-for="(system, j) in item.children" :key="j" :title="system.label" class="line">
<el-checkbox v-model="system.check" @change="val => systemChange(val, system, item)"></el-checkbox>
<div :class="['name', { active: curSystem == item.id }]" @click="getProject(system)">
<span>{{ system.label }}</span>
<i class="el-icon-arrow-right"></i>
</div>
</div>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="item project"> <div class="item project">
<div class="title-wrap flex-center"> <h6 class="p-title">项目列表</h6>
<p class="addhr_tag"></p>
<span>项目列表</span>
</div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" <el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword"
clearable></el-input> clearable></el-input>
<ul class="systems"> <ul class="projects">
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选" <el-checkbox v-if="projects.length" v-model="checkAll" label="全选"
@change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox> @change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects" :key="i" :title="item.projectName"> <li v-for="(item, i) in projects" :key="i" :title="item.projectName">
@ -257,33 +262,33 @@
</div> </div>
<div class="item checked"> <div class="item checked">
<div class="title-wrap flex-center"> <template v-if="checkeds.length">
<p class="addhr_tag"></p> <div class="flex-between m-b-10">
<span>已选择项目{{ checkeds.length }}</span> <p class="total">已选项目{{ checkeds.length }}</p>
</div> <el-button type="text" @click="batchDelChecked">批量移除</el-button>
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" </div>
v-model.trim="checkedKeyword" clearable></el-input>
<el-table :data="checkeds" class="table" header-align="center" max-height="470"> <el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="checkedKeyword" clearable></el-input>
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column>
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> <div class="lines">
<el-table-column prop="projectName" width="80" label="系统类型" align="center"> <template v-for="(item, i) in checkeds">
<template slot-scope="scope"> <div v-if="item.projectName.includes(checkedKeyword)" :key="i" class="line">
{{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }} <div class="check-left">
</template> <el-checkbox v-model="item.check"></el-checkbox>
</el-table-column> <span class="serial">{{ i + 1 }}</span>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> <el-tooltip effect="dark" :content="item.projectName" placement="top-start">
<el-table-column prop="projectName" label="项目名称" align="center"> <p class="checked-name ellipsis">{{ item.projectName }}</p>
<template slot-scope="scope"> </el-tooltip>
{{ scope.row.projectName || scope.row.paperName }} </div>
</template> <i class="el-icon-delete action-icon" @click="delProject(item)"></i>
</el-table-column> </div>
<el-table-column label="操作" align="center" width="55">
<template slot-scope="scope">
<i :class="['el-icon-delete rm', { disabled: scope.row.disabled }]"
@click="delProject(scope.$index, scope.row)"></i>
</template> </template>
</el-table-column> </div>
</el-table> </template>
<div v-else class="none">
<img class="icon" src="@/assets/img/empty.svg" alt="">
<p>暂无数据</p>
</div>
</div> </div>
</div> </div>
@ -291,7 +296,7 @@
<el-button @click="configVisible = false"> </el-button> <el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button> <el-button type="primary" @click="handleConfirm"> </el-button>
</span> </span>
</el-dialog> </el-drawer>
</div> </div>
</template> </template>
@ -301,6 +306,7 @@ import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/components/editor' import editorConfig from '@/components/editor'
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
import _ from 'lodash'
export default { export default {
components: { components: {
Editor, Editor,
@ -308,11 +314,8 @@ export default {
data () { data () {
return { return {
cid: this.$route.query.cid, cid: this.$route.query.cid,
headers: {
token: sessionStorage.getItem("token")
},
editorConfig, editorConfig,
step: 1, step: 2,
form: { form: {
curriculumName: "", curriculumName: "",
curriculumType: '', curriculumType: '',
@ -325,7 +328,6 @@ export default {
teachingObjectives: "", teachingObjectives: "",
systemIdByAssessment: [], systemIdByAssessment: [],
systemIdByPractice: [], systemIdByPractice: [],
supplier: [],
coverUrl: 'https://izhixinyun.com/images/course-cover.png', coverUrl: 'https://izhixinyun.com/images/course-cover.png',
curriculumDisciplines: [ curriculumDisciplines: [
{ {
@ -350,9 +352,6 @@ export default {
professionalId: [ professionalId: [
{ required: true, message: "请选择专业", trigger: "change" } { required: true, message: "请选择专业", trigger: "change" }
], ],
supplier: [
{ required: true, message: "请选择供应厂商", trigger: "change" }
],
expectedCourse: [ expectedCourse: [
{ required: true, message: "请选择预计课时", trigger: "change" } { required: true, message: "请选择预计课时", trigger: "change" }
], ],
@ -364,17 +363,14 @@ export default {
], ],
}, },
subjectList: [], subjectList: [],
ProfessionalClassList: [],
ProfessionalList: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
multipleSelection: [], multipleSelection: [],
systemKeyword: "",
searchTimer: null, searchTimer: null,
configVisible: false,// configVisible: false,//
permissions: "", // 01 permissions: '', // 01
practiceData: [], practiceData: [],
practiceTotal: 0, practiceTotal: 0,
multiplePractice: [], multiplePractice: [],
@ -387,7 +383,6 @@ export default {
updateTime: 0, updateTime: 0,
systemAll: [], systemAll: [],
systems: [], systems: [],
systemsAll: [],
systemChecked: [], systemChecked: [],
curSystem: '', curSystem: '',
projects: [], projects: [],
@ -397,17 +392,6 @@ export default {
checkedAll: [], checkedAll: [],
checkAll: false, checkAll: false,
status: [
{
id: 0,
name: '正常'
}
],
practiceData: [],
practiceTotal: 0,
multiplePractice: [],
assessmentData: [], assessmentData: [],
assessmentTotal: 0, assessmentTotal: 0,
multipleAssessment: [], multipleAssessment: [],
@ -421,54 +405,28 @@ export default {
}, },
deep: true deep: true
}, },
systemKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getConfig();
}, 500);
},
projectKeyword: function (val) { projectKeyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getProject(); this.getProject()
}, 500); }, 500)
}, },
checkedKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.filterChecked();
}, 500);
}
}, },
created () { created () {
}, },
mounted () { mounted () {
this.getSubject() this.getSubject()
this.getConfig() this.getCourseSystem()
this.getSystem()
this.cid && this.getInfoData() this.cid && this.getInfoData()
}, },
methods: { methods: {
getInfoData () { getInfoData () {
this.$post(`${this.api.curriculumDetail}?cid=${this.cid}`).then(({ data }) => { 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.form = data
this.practiceData = data.practiceConfig
this.assessmentData = data.assessmentConfig
this.$nextTick(() => { 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.form.curriculumDisciplines.forEach(e => {
this.$set(e, 'professionalClassList', []) this.$set(e, 'professionalClassList', [])
this.$set(e, 'professionalList', []) this.$set(e, 'professionalList', [])
@ -478,26 +436,31 @@ export default {
if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '') if (!e.professionalCategoryId) this.$set(e, 'professionalCategoryId', '')
if (!e.professionalId) this.$set(e, 'professionalId', '') 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 => { }) }).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 () { addSubject () {
@ -582,56 +545,12 @@ export default {
this.form.coverUrl = '' this.form.coverUrl = ''
}, },
// //
getConfig () { courseChange (val, item) {
const checked = this[!this.permissions ? item.children.map(e => e.check = val)
'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
}, },
// //
systemChange (val, item) { async systemChange (val, system, course) {
// //
const { projects, checkeds } = this const { projects, checkeds } = this
if (projects.length && projects[0].systemId == item.systemId) { if (projects.length && projects[0].systemId == item.systemId) {
@ -640,27 +559,55 @@ export default {
}) })
} }
this.projectKeyword = '' 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 (val) {
// i === -1 && checkeds.push(e)
if (!this.mulSystem) { } else if (i !== -1) {
this.systems.map(e => e.check = false) checkeds.splice(i, 1)
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)
})
} }
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) // })
this.getProject(item, 1) this.checkedAll = _.cloneDeep(checkeds) //
}).catch(err => { }) },
//
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) { 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)) const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId))
// push // push
if (val) { if (val) {
this.checkeds.push(item) i === -1 && this.checkeds.push(item)
} else if (i !== -1) { } else if (i !== -1) {
this.checkeds.splice(i, 1) this.checkeds.splice(i, 1)
} }
@ -686,11 +633,6 @@ export default {
this.checkAll = !this.projects.find(e => !e.check) // this.checkAll = !this.projects.find(e => !e.check) //
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // 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) { delProject (i, e) {
if (e.disabled) return if (e.disabled) return
@ -730,9 +672,6 @@ export default {
} else if (this.permissions == 1) { } else if (this.permissions == 1) {
this.assessmentData = JSON.parse(JSON.stringify(list)) this.assessmentData = JSON.parse(JSON.stringify(list))
this.assessmentTotal = this.assessmentData.length; 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) { handleConfig (type) {
this.systemKeyword = ''
this.projectKeyword = '' this.projectKeyword = ''
this.checkedKeyword = '' this.checkedKeyword = ''
this.permissions = type; this.permissions = type;
this.configVisible = true; this.configVisible = true;
this.pageNo = 1; this.pageNo = 1
this.getConfig();
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData)) this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData))
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) this.checkedAll = JSON.parse(JSON.stringify(this.checkeds))
}, },
@ -828,7 +765,6 @@ export default {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
form.supplier = form.supplier.join()
form.platformId = Setting.platformId form.platformId = Setting.platformId
this.submiting = true this.submiting = true
this.loadIns = this.$loading({ this.loadIns = this.$loading({
@ -1082,27 +1018,65 @@ export default {
} }
/deep/.config-dia { /deep/.config-dia {
.config-wrap { .el-drawer__header {
padding-bottom: 20px;
margin-bottom: 0;
border-bottom: 1px solid #eee;
}
.none {
display: flex; 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; margin-bottom: 15px;
} }
.config-wrap {
display: flex;
padding: 15px;
}
.item { .item {
width: 250px; width: 350px;
max-height: 600px; height: calc(100vh - 93px);
padding: 10px; padding: 10px;
margin-right: 20px; margin-right: 20px;
overflow: hidden; overflow: hidden;
&.project {
border-right: 1px solid #eee;
}
} }
.system { .system {
width: 350px;
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.systems { .systems {
max-height: calc(100vh - 133px);
margin-top: 10px;
overflow: auto;
.line {
&>.name {
span {
max-width: 280px;
}
}
}
}
.projects {
margin-top: 10px; margin-top: 10px;
max-height: 520px; max-height: 520px;
overflow: auto; overflow: auto;
@ -1112,25 +1086,35 @@ export default {
align-items: center; align-items: center;
margin: 10px 0; 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 { span {
display: inline-flex; max-width: 200px;
flex: 1; text-overflow: ellipsis;
justify-content: space-between; white-space: nowrap;
align-items: center; overflow: hidden;
margin-left: 5px; }
cursor: pointer; }
&.active, .children {
&:hover { padding-left: 20px;
color: #062c87;
}
.name {
span { span {
max-width: 200px; max-width: 265px !important;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
} }
} }
@ -1138,24 +1122,42 @@ export default {
.checked { .checked {
flex: 1; flex: 1;
width: auto; width: auto;
}
.el-table .cell { .lines {
font-size: 12px; height: calc(100vh - 228px);
} padding-right: 10px;
margin-top: 10px;
overflow: auto;
} }
.rm { .line {
font-size: 14px; display: flex;
cursor: pointer; align-items: center;
padding: 5px 0;
color: #333;
}
&.disabled { .serial {
color: #ccc; width: 32px;
cursor: not-allowed; margin: 0 12px;
} text-align: center;
white-space: nowrap;
}
&:hover { .check-left {
color: #17161f; display: inline-flex;
} align-items: center;
}
.checked-name {
width: 360px;
margin-right: 20px;
}
.action-icon {
font-size: 14px;
cursor: pointer;
} }
} }
</style> </style>

@ -44,8 +44,8 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model="form.curriculumName" clearable <el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model="form.curriculumName"
@keyup.enter.native="onSearch"></el-input> clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -65,7 +65,7 @@
</div> </div>
</div> </div>
<el-table v-loading="loading" :data="courseData" class="table" ref="table" header-align="center" <el-table v-loading="loading" :data="courseData" class="table" ref="table" header-align="center"
@selection-change="handleSelectionChange" :row-key="getRowKeys"> @selection-change="handleSelectionChange" row-key="cid">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column> <el-table-column type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column> <el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column>
@ -146,9 +146,6 @@ export default {
this.getData(); this.getData();
}, },
methods: { methods: {
getRowKeys (row) {
return row.cid;
},
// //
getData () { getData () {
this.$post(this.api.curriculumList, { this.$post(this.api.curriculumList, {
@ -274,27 +271,21 @@ export default {
} }
}).catch(err => { }) }).catch(err => { })
} else { } else {
this.$message.warning("请先选择课程 !"); this.$message.warning("请先选择课程 !")
} }
}, },
// //
handleCurrentChange (val) { handleCurrentChange (val) {
this.page = val; this.page = val
this.$router.push(`/curriculum?page=${val}`) this.$router.push(`list?page=${val}`)
this.getData(); this.getData()
},
//
onSearch () {
this.page = 1;
this.getData();
}, },
// //
changeSwitch (value, row) { changeSwitch (value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => { this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => {
this.getData(); this.getData()
this.$message.success("修改上下架状态成功!"); this.$message.success("修改上下架状态成功!")
}).catch((res) => { }).catch((res) => { })
});
} }
} }
}; };

@ -389,4 +389,9 @@
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
}
.el-drawer__header > :first-child {
font-size: 16px;
font-weight: 600;
color: #333;
} }
Loading…
Cancel
Save