main
parent
d5ecd33bc1
commit
aa4c6c1464
8 changed files with 1151 additions and 0 deletions
@ -0,0 +1,199 @@ |
||||
<template xmlns="http://www.w3.org/1999/html"> |
||||
<div id="components-layout-demo-basic" style="padding-top: 20px"> |
||||
<a-layout> |
||||
<a-layout-header> |
||||
|
||||
<CourseTitle :context="getInfoid" :setNum="setNum"></CourseTitle> |
||||
</a-layout-header> |
||||
<a-layout-content> |
||||
<a-form-model :model="formTest" :rules="rulesTest" > |
||||
<a-form-model-item label="过程性考核" prop="commonScore" :label-col="wrapperCol" :wrapper-col="wrapperCol"> |
||||
<a-input v-model="formTest.processAssessment" addon-after="%" @blur="changeScore" /> |
||||
</a-form-model-item> |
||||
|
||||
<a-form-model-item label="期末考试" prop="testScore" :label-col="wrapperCol" :wrapper-col="wrapperCol"> |
||||
<a-input v-model="formTest.finalExam" addon-after="%" @blur="changeScore"/> |
||||
</a-form-model-item> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-item label="考核细则" :label-col="wrapperCol" :wrapper-col="labelCol" > |
||||
<j-editor v-model="model.assessmentrules" /> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
|
||||
|
||||
<a-form-item label="考核内容" :label-col="wrapperCol" :wrapper-col="labelCol"> |
||||
<j-editor v-model="model.contentdistribution" /> |
||||
</a-form-item> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form-model> |
||||
|
||||
|
||||
|
||||
</a-layout-content> |
||||
<a-layout-footer> |
||||
<div class="sub-down"> |
||||
<a-button @click="setSub" style="margin-right: 10px">上一步</a-button> |
||||
<a-button @click="setAdd" type="primary">{{setNum==4?'完成':'下一步'}}</a-button> |
||||
</div> |
||||
</a-layout-footer> |
||||
</a-layout> |
||||
</div> |
||||
|
||||
</template> |
||||
|
||||
<script> |
||||
import CourseTitle from "./CouseTitle" |
||||
import {getAction,postAction,deleteAction,putAction} from '@/api/manage' |
||||
//富文本框 |
||||
import JEditor from '@/components/jeecg/JEditor' |
||||
export default { |
||||
name: "TestWay", |
||||
components: { |
||||
JEditor, |
||||
}, |
||||
data () { |
||||
return{ |
||||
model: {}, |
||||
formTest:{ |
||||
id:'', |
||||
processAssessment:0, |
||||
finalExam:0, |
||||
name:'' |
||||
}, |
||||
scoreUrl:{ |
||||
getInfoUrl:'/course/seCourse1/methodList', |
||||
getChangeScore:'/course/seCourse1/methodadd', |
||||
editnrxz:'/course/seCourse/editnrxz', |
||||
getnrxz:'/course/seCourse/getnrxz', |
||||
}, |
||||
labelCol: { span: 14}, |
||||
wrapperCol: { span: 2 }, |
||||
setNum:4, |
||||
rulesTest:{ |
||||
processAssessment:[ |
||||
{ required: true, message: '请输入过程性考核占比', trigger: 'blur' }, |
||||
{ min: 1, max: 3, message: 'Length should be 3 to 5', trigger: 'blur' }, |
||||
], |
||||
finalExam:[ |
||||
{ required: true, message: '请输入期末考试占比', trigger: 'blur' }, |
||||
{ min: 1, max: 3, message: 'Length should be 3 to 5', trigger: 'blur' }, |
||||
], |
||||
} |
||||
} |
||||
}, |
||||
components:{CourseTitle}, |
||||
computed: { |
||||
getInfoid() { |
||||
return this.$route.query |
||||
}, |
||||
}, |
||||
mounted() { |
||||
this.getInfoScore(); |
||||
getAction(this.scoreUrl.getnrxz, {id: this.getInfoid.courseid}).then((res) => { |
||||
if (res.result!==null&&res.code===200) { |
||||
this.model=res.result |
||||
} |
||||
}) |
||||
}, |
||||
methods:{ |
||||
//获取数据 |
||||
async getInfoScore(){ |
||||
let res=await getAction(this.scoreUrl.getInfoUrl, {id: this.getInfoid.courseid}) |
||||
if (res.result!==null&&res.code===200) this.formTest=res.result |
||||
console.log(res) |
||||
}, |
||||
//修改 |
||||
async changeScore(){ |
||||
let {processAssessment,finalExam}=this.formTest |
||||
let score=processAssessment*1+finalExam*1 |
||||
if (score!==100){ |
||||
console.log(score) |
||||
let alt= () =>{ this.openNotificationWithIcon('warning')} |
||||
alt() |
||||
return |
||||
} |
||||
this.formTest.name=this.getInfoid.courseid |
||||
// 发送请求 |
||||
let res=await postAction(this.scoreUrl.getChangeScore,this.formTest) |
||||
console.log(res) |
||||
}, |
||||
//弹出提示 |
||||
openNotificationWithIcon(type) { |
||||
this.$notification[type]({ |
||||
message: '未达成需求', |
||||
description: |
||||
'考核方式需要达成条件:过程性考核+期末考试=100', |
||||
}); |
||||
}, |
||||
//下一步 |
||||
setAdd(){ |
||||
putAction(this.scoreUrl.editnrxz, { |
||||
id: this.getInfoid.courseid, |
||||
assessmentrules: this.model.assessmentrules, |
||||
contentdistribution: this.model.contentdistribution, |
||||
}).then((res) => { |
||||
if (res.code != 200) { |
||||
this.$message.error(res.message) |
||||
} else { |
||||
if (this.setNum<4){ |
||||
this.setNum++ |
||||
} |
||||
this.$router.push({ path: '/src/views/course/SeCourseList' }) |
||||
this.$message.success(res.message) |
||||
} |
||||
}) |
||||
}, |
||||
// 上一步 |
||||
setSub(){ |
||||
if (this.setNum>0){ |
||||
this.setNum--; |
||||
this.$router.go(-1) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
</script> |
||||
|
||||
<style scoped> |
||||
#components-layout-demo-basic { |
||||
/*text-align: center;*/ |
||||
min-height:550px; |
||||
background-color:#fff; |
||||
} |
||||
#components-layout-demo-basic .ant-layout-header, |
||||
#components-layout-demo-basic .ant-layout-footer { |
||||
background: #fff; |
||||
/*color: #fff;*/ |
||||
} |
||||
#components-layout-demo-basic .ant-layout-header{ |
||||
height:200px; |
||||
} |
||||
#components-layout-demo-basic .ant-layout-footer { |
||||
/*line-height: 1.5;*/ |
||||
} |
||||
#components-layout-demo-basic .ant-layout-content { |
||||
background: #fff; |
||||
color: #000; |
||||
min-height: 120px; |
||||
/*line-height: 60px;*/ |
||||
} |
||||
#components-layout-demo-basic > .ant-layout { |
||||
/*margin-bottom: 48px;*/ |
||||
} |
||||
#components-layout-demo-basic > .ant-layout:last-child { |
||||
/*margin: 0;*/ |
||||
} |
||||
th.column-money, |
||||
td.column-money { |
||||
text-align: right !important; |
||||
} |
||||
.sub-down{ |
||||
text-align:center; |
||||
} |
||||
</style> |
@ -0,0 +1,454 @@ |
||||
<template> |
||||
<div> |
||||
<div v-for="item in formData" :key="item.id"> |
||||
<el-row class="warp_content"> |
||||
<!-- type="flex" justify="center" --> |
||||
|
||||
<el-col :span="6"> |
||||
<el-input v-if="item.read" v-model="item.name"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
<i class="el-icon-plus" @click="expandList(item)"></i> |
||||
{{item.name}} |
||||
</el-col> |
||||
</el-row> |
||||
</el-col> |
||||
<!-- <el-col :span="4"> |
||||
<el-input v-model="item.chapterName" :readonly="!item.read"></el-input> |
||||
</el-col> --> |
||||
<el-col :span="3"> |
||||
<el-input v-if="item.read" v-model="item.totalclasshours"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
<!-- <el-button color="red" type="text">{{item.totalclasshours}}</el-button> --> |
||||
{{item.totalclasshours}} |
||||
|
||||
</el-col> |
||||
</el-row> |
||||
</el-col> |
||||
<!-- <el-col :span="3"> |
||||
<el-input v-if="item.read" v-model="item.childChapter"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
{{item.childChapter.length}} |
||||
</el-col> |
||||
</el-row> |
||||
</el-col> --> |
||||
<el-col :span="7" class="dominate"> |
||||
<!-- <el-input v-model="item.dominate" :readonly="!item.read"> |
||||
</el-input> --> |
||||
共{{item.childChapter.length}}小节 已经分配 {{item.showListstudyTime}}学时 未分配{{ (item.totalclasshours-item.showListstudyTime).toFixed(1) }}学时 |
||||
</el-col> |
||||
<el-col :span="4" class="operation"> |
||||
|
||||
<!-- <a @click="deleteList">删除</a> |
||||
<a @click="editList">修改</a> --> |
||||
<el-button @click="deleteList1(item)" size="small" type="primary">删除</el-button> |
||||
<el-button v-if="!item.showEdit" @click="editList(item)" size="small">修改</el-button> |
||||
<el-button v-if="item.showEdit" @click="editList(item)" size="small">确认</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
<!-- 子节点列表数据 --> |
||||
<div v-show="item.showList" class="childList"> |
||||
<el-table :data=" item.childChapter" style="width: 100%"> |
||||
<el-table-column prop="index" label="" width="40"> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label=""> |
||||
<template #default="{row}"> |
||||
<el-input v-if="row.read" v-model="row.name"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
<!-- <el-button type="text">{{row.name}}</el-button> --> |
||||
{{row.name}} |
||||
</el-col> |
||||
</el-row> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="totalclasshours" label="" width="180"> |
||||
<template #default="{row}"> |
||||
|
||||
<el-input v-if="row.read" v-model="row.totalclasshours"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
<!-- <el-button type="text">{{row.totalclasshours}}</el-button> --> |
||||
{{row.totalclasshours}} |
||||
</el-col> |
||||
</el-row> |
||||
</template> |
||||
</el-table-column> |
||||
|
||||
<el-table-column prop="" label="" class="shours"> |
||||
<template #default="{row}"> |
||||
<!-- {{ (item.totalclasshours- row.timeShowReduce).toFixed(1) }} --> |
||||
已经分配 {{row.totalclasshours}}学时 未分配学时 |
||||
</template> |
||||
</el-table-column> |
||||
|
||||
<el-table-column label="" class="chapterButton"> |
||||
<template scope="{row}"> |
||||
<el-button @click="deleteList(item,row)" size="small" type="primary">删除</el-button> |
||||
<el-button v-if="!row.showEdit" @click="editList(row)" size="small">修改</el-button> |
||||
<el-button v-if="row.showEdit" @click="editList(row)" size="small">确认</el-button> |
||||
</template> |
||||
<!-- <el-button @click="deleteList(item,list)" size="small" type="primary">删除</el-button> |
||||
<el-button v-if="!list.showEdit" @click="editList(list)" size="small">修改</el-button> |
||||
<el-button v-if="list.showEdit" @click="editList(list)" size="small">确认</el-button> --> |
||||
</el-table-column> |
||||
</el-table> |
||||
<!-- 新增列表数据 --> |
||||
<el-row class="middleList" v-if="item.showMidList"> |
||||
<!-- <el-col :span="1"> |
||||
<el-input v-model="addListData.index"></el-input> |
||||
</el-col> --> |
||||
<el-col :span="4"> |
||||
<el-input v-model="addListData.name"></el-input> |
||||
</el-col> |
||||
<!-- <el-col :span="4"> |
||||
<el-input v-model="addListData.chapterName" ></el-input> |
||||
</el-col> --> |
||||
<el-col :span="4"> |
||||
<el-input v-model="addListData.totalclasshours"></el-input> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<div class="operation1"> |
||||
<el-button @click="deleteList2(item)" size="small" >取消</el-button> |
||||
<el-button @click="addList(item)" size="small" type="primary">确定</el-button> |
||||
</div> |
||||
</el-col> |
||||
</el-row> |
||||
<el-row> |
||||
<el-col class="newButton"> |
||||
<el-button v-if="item.showMidList" type="primary" size="small" @click="addList(item)">确定</el-button> |
||||
<el-button v-else type="primary" size="small" @click="newList(item)">新一节</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</div> |
||||
<el-divider></el-divider> |
||||
<!-- 新一章 --> |
||||
<div v-if="showChapter"> |
||||
<el-row> |
||||
<el-form label-width="70px"> |
||||
<el-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<el-form-item label="章节名称"> |
||||
<el-input v-model="queryParam.name" label-width="80px"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<el-form-item label="学时"> |
||||
<el-input v-model="queryParam.totalclasshours" label-width="80px"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-form> |
||||
</el-row> |
||||
<el-row> |
||||
<el-form label-width="70px"> |
||||
<el-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<el-form-item label="说明"> |
||||
<el-input type="textarea" v-model="queryParam.content" :autosize="{ minRows: 3, maxRows: 4}"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-form> |
||||
<el-button @click="submitChapter(queryParam)" type="primary" size="small" class="submitChapter1">确定</el-button> |
||||
<el-button @click="submitChapter1(queryParam)" size="small" class="submitChapter1">取消</el-button> |
||||
</el-row> |
||||
<!-- <el-row> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="学时" prop=""> |
||||
<a-input placeholder="请输入学时" v-model="queryParam.totalclasshours"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
</el-row> --> |
||||
<!-- <el-row> |
||||
<el-form label-width="80px"> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="说明" prop=""> |
||||
<a-textarea placeholder="" :rows="4" v-model="queryParam.content" /> |
||||
</a-form-item> |
||||
</a-col> |
||||
</el-form> |
||||
</el-row> --> |
||||
<!-- <el-button @click="submitChapter(queryParam)" type="primary" size="small" class="submitChapter1">确定</el-button> --> |
||||
</div> |
||||
<el-button @click="showCha" type="primary" size="small" class="newChapterButton">新一章</el-button> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage.js' |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
formData: [], |
||||
showList: false, |
||||
showMidList: false, |
||||
showEdit: true, |
||||
read: true, |
||||
courseid: { |
||||
// id:'1298175613105115137' |
||||
id: '', |
||||
}, |
||||
addListData: { |
||||
courseid: '', |
||||
name: '', |
||||
totalclasshours: '', |
||||
pid: '', |
||||
}, |
||||
//新一章 |
||||
showChapter: false, |
||||
//新一章传入数据 |
||||
queryParam: { |
||||
name: '', |
||||
pid: '', |
||||
totalclasshours: '', |
||||
content: '', |
||||
courseid: '', |
||||
}, |
||||
showListstudyTime: 0, |
||||
url: { |
||||
list: '/course/seCourse/listSeChapterByCourseId', |
||||
add: '/course/seCourse/addSeChapter', |
||||
delete: '/course/seCourse/deleteSeChapter', |
||||
edit: '/course/seCourse/editSeChapter', |
||||
}, |
||||
} |
||||
}, |
||||
props: { |
||||
getInfoid: { |
||||
type: Object, |
||||
}, |
||||
}, |
||||
watch: { |
||||
formData: { |
||||
handler() { |
||||
// console.log(this.formData, 'reduce数据') |
||||
this.formData.map((res) => { |
||||
//每一个 {} |
||||
// let times = 0; |
||||
this.$set( |
||||
res, |
||||
'showListstudyTime', |
||||
res.childChapter.reduce((pre, current) => { |
||||
// let time = parseFloat(current.totalclasshours?current.totalclasshours:0) |
||||
// this.$set(current,'timeShowReduce',times+=time) |
||||
return (pre += window.parseFloat(current.totalclasshours) |
||||
? window.parseFloat(current.totalclasshours) |
||||
: 0) |
||||
}, 0) |
||||
) |
||||
}) |
||||
return null |
||||
}, |
||||
deep: true, |
||||
immediate: true, |
||||
}, |
||||
}, |
||||
|
||||
computed: {}, |
||||
created() { |
||||
this.showListData() |
||||
}, |
||||
methods: { |
||||
async deleteList1(item) { |
||||
await deleteAction(this.url.delete, { id: item.id }) |
||||
// this.$delete(item,id) |
||||
this.showListData() |
||||
}, |
||||
async showListData() { |
||||
this.courseid.id = this.getInfoid.courseid |
||||
console.log(this.courseid, '章节') |
||||
let res = await getAction(this.url.list, this.courseid) |
||||
this.formData = res.result.chapterList |
||||
console.log(this.formData, '接口数据 ') |
||||
// this.$set(this.formData.childChapter,'showList',false) |
||||
// this.$set(this.formData,'showList',false) |
||||
}, |
||||
expandList(item) { |
||||
item.showList = !item.showList |
||||
// this.$set(item,'showList',!item.showList) |
||||
}, |
||||
//点击修改 |
||||
async editList(item) { |
||||
this.$set(item, 'read', !item.read) |
||||
this.$set(item, 'showEdit', !item.showEdit) |
||||
await putAction(this.url.edit, item) |
||||
}, |
||||
//点击修改后的确定 |
||||
submitEdit() {}, |
||||
//删除 |
||||
async deleteList(oldData, deleteDate) { |
||||
await deleteAction(this.url.delete, { id: deleteDate.id }) |
||||
oldData.childChapter.find((res, key) => { |
||||
if (res == deleteDate) { |
||||
this.$delete(oldData.childChapter, key) |
||||
} |
||||
}) |
||||
// await deleteAction(this.url.delete,{id:oldData.id}) |
||||
// console.log(oldData.id,'新一章删除') |
||||
|
||||
// await deleteAction(this.url.delete,{id:deleteDate.id}) |
||||
// oldData.childChapter.find((res, key) => { |
||||
// if (res == deleteDate) { |
||||
// console.log('删除') |
||||
// this.$delete(oldData.childChapter, key) |
||||
// } |
||||
// }) |
||||
}, |
||||
deleteList2(item){ |
||||
item.showMidList=!item.showMidList |
||||
}, |
||||
showCha() { |
||||
;(this.showChapter = true), |
||||
(this.queryParam = { |
||||
name: '', |
||||
totalclasshours: '', |
||||
pid: '', |
||||
content: '', |
||||
courseid: '', |
||||
}) |
||||
}, |
||||
async submitChapter(queryParam) { |
||||
// console.log(queryParam,'新一章的数据') |
||||
this.queryParam.courseid = this.courseid.id |
||||
let res = await postAction(this.url.add, this.queryParam) |
||||
this.formData.push(this.queryParam) |
||||
if ((res.code = 200)) { |
||||
this.$message.success(res.message) |
||||
} else { |
||||
this.$message.error(res.message) |
||||
} |
||||
|
||||
// console.log(res,'abc') |
||||
// this.queryParam = { |
||||
// name: '', |
||||
// totalclasshours: '', |
||||
// pid:'', |
||||
// content:'', |
||||
// courseid:'', |
||||
// minutia: '', |
||||
// dominate: '', |
||||
// index: '', |
||||
// } |
||||
this.showChapter = false |
||||
this.showListData() |
||||
}, |
||||
submitChapter1(){ |
||||
this.showChapter = false |
||||
}, |
||||
newList(item) { |
||||
this.$set(item, 'showMidList', !item.showMidList) |
||||
}, |
||||
//新一节里的确认 |
||||
async addList(item) { |
||||
this.$set(item, 'showMidList', !item.showMidList) |
||||
// console.log(item.showListstudyTime, item.totalclasshours) |
||||
if ( |
||||
item.showListstudyTime + parseInt(this.addListData.totalclasshours) <= |
||||
window.parseInt(item.totalclasshours) |
||||
) { |
||||
this.addListData.courseid = item.courseid |
||||
this.addListData.pid = item.id |
||||
item.childChapter.push(this.addListData) |
||||
await postAction(this.url.add, this.addListData) |
||||
console.log(this.addListData, '新增一节数据') |
||||
// item.formDataChild.push(this.addListData) |
||||
this.$message.success('添加新一节成功') |
||||
//清空数据 |
||||
this.addListData = { |
||||
name: '', |
||||
courseid: '', |
||||
totalclasshours: '', |
||||
pid: '', |
||||
} |
||||
} else { |
||||
this.$message.error('学时不符合要求') |
||||
} |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
.warp_content { |
||||
background: rgb(245 245 245); |
||||
margin-bottom: 3px; |
||||
display: flex; |
||||
align-items: center; |
||||
text-align: center; |
||||
} |
||||
.warp_content > div:nth-child(1) { |
||||
text-align: start; |
||||
} |
||||
.el-icon-plus { |
||||
/* text-align: center; */ |
||||
} |
||||
.middleList { |
||||
margin-left: 50px; |
||||
} |
||||
.icon { |
||||
margin-top: 3px; |
||||
} |
||||
.operation { |
||||
/* margin-top: 4px; */ |
||||
margin-left: 50px; |
||||
|
||||
} |
||||
.operation1 { |
||||
/* margin-top: 4px; */ |
||||
margin-left:597px; |
||||
} |
||||
.dominate { |
||||
/* margin-top: 6px; */ |
||||
height: 40px; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
} |
||||
/* .childList{ |
||||
margin-left: 40px; |
||||
} */ |
||||
/* |
||||
.el-input [type='text']{ |
||||
border: none; |
||||
}*/ |
||||
.submitChapter1 { |
||||
/* margin-left: 22%; */ |
||||
margin-left:70px; |
||||
margin-top: 40px; |
||||
/* margin-bottom: 30px; */ |
||||
} |
||||
.newChapterButton{ |
||||
/* margin-left: 20px; */ |
||||
} |
||||
.newButton { |
||||
margin-left: 90%; |
||||
|
||||
} |
||||
.has-gutter > tr { |
||||
display: none; |
||||
} |
||||
.el-table__row { |
||||
height: 30px; |
||||
} |
||||
.el-input__inner { |
||||
height: 30px; |
||||
} |
||||
.el-icon-plus { |
||||
margin-right: 10px; |
||||
margin-left: 10px; |
||||
} |
||||
.chapterButton { |
||||
} |
||||
.el-table .el-table__cell { |
||||
padding: 8px 0; |
||||
} |
||||
.shours { |
||||
margin-right: 30px; |
||||
} |
||||
</style> |
@ -0,0 +1,82 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<CourseTitle :context="getInfoid" :setNum="setNum"></CourseTitle> |
||||
<br/> |
||||
<div class="table-page-search-wrapper"> |
||||
<div> |
||||
<!-- 蓝色框 --> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 |
||||
<a style="font-weight: 600"></a |
||||
>项 |
||||
<a style="margin-left: 24px" >清空</a> |
||||
</div> |
||||
<!-- 新增 --> |
||||
|
||||
<!-- 表单 --> |
||||
<ChapterList :getInfoid="getInfoid"></ChapterList> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
<div class="sub-down"> |
||||
<a-button @click="setSub">上一步</a-button> |
||||
<a-button @click="setAdd" type="primary">{{setNum==4?'完成':'下一步'}}</a-button> |
||||
</div> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
import ChapterList from './chapterList.vue' |
||||
import CourseTitle from './CouseTitle.vue' |
||||
|
||||
export default{ |
||||
components:{ChapterList, CourseTitle}, |
||||
data(){ |
||||
return{ |
||||
setNum:1, |
||||
} |
||||
}, |
||||
mounted(){ |
||||
console.log(this.getInfoid); |
||||
}, |
||||
|
||||
computed:{ |
||||
getInfoid(){ |
||||
return this.$route.query |
||||
} |
||||
}, |
||||
methods:{ |
||||
//下一步 |
||||
setAdd(){ |
||||
if (this.setNum<3){ |
||||
this.setNum++ |
||||
this.$router.push({ |
||||
path:'/knowledgeManage', |
||||
query:this.tokenid |
||||
}) |
||||
} |
||||
}, |
||||
// 上一步 |
||||
setSub(){ |
||||
if (this.setNum>0){ |
||||
this.setNum--; |
||||
this.$router.go(-1) |
||||
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
|
||||
.sub-down{ |
||||
text-align:center; |
||||
} |
||||
.sub-down{ |
||||
text-align:center; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,359 @@ |
||||
<template> |
||||
<div> |
||||
<el-card> |
||||
<!-- 头部 --> |
||||
<CouseTitle :context="getInfoid" :setNum="setNum"></CouseTitle> |
||||
<br /> |
||||
<!-- 蓝色框 --> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 |
||||
<a style="font-weight: 600"></a>项 |
||||
<a style="margin-left: 24px">清空</a> |
||||
</div> |
||||
<!--章--> |
||||
<div class="c" v-for="items in formData" :key="items.id"> |
||||
<section class="recomSiteText"> |
||||
<!-- 第一列表 --> |
||||
<el-row class="content_list" :gutter="20"> |
||||
<el-col :span="6"> |
||||
<i class="el-icon-plus" @click=" $set(items,'listShow',!items.listShow) "></i> |
||||
{{items.name}} |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
{{items.totalclasshours}}学时 |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
{{items.childCount}} |
||||
<!-- {{items.childChapter.length}} --> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
已分配 {{items.usedKnow}} 学时 剩余 {{items.leaveKnow}} 学时 |
||||
</el-col> |
||||
</el-row> |
||||
</section> |
||||
<section v-show="items.listShow" class="contentSized"> |
||||
<!-- 次级列表 --> |
||||
<div v-for="item in items.childChapter" :key="item.id"> |
||||
<el-row class="align_center"> |
||||
<el-col :span="6"> |
||||
<i class="el-icon-plus" @click="$set(item,'listShow',!item.listShow) "></i> |
||||
{{item.name}} |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
{{item.totalclasshours}} 学时 |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
已经分配{{item.usedKnow}} 未分配{{item.konwLeave}} |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-button type="primary" size="small" @click="knowledgeManageDialog(item)">管理知识点</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
<section v-show="item.listShow" class="PivotContentWC" v-for="list in item.knowcourses" :key="list.knowid"> |
||||
<!-- 次级列表数据--> |
||||
<div> |
||||
<span> |
||||
{{list.know}} |
||||
</span> |
||||
<span> |
||||
学时 {{list.xs}} |
||||
</span> |
||||
</div> |
||||
</section> |
||||
</div> |
||||
</section> |
||||
</div> |
||||
<!-- 弹窗 --> |
||||
<el-dialog class="dialogContent" :visible.sync="dialogVisible" width="60%" :before-close="handleClose" title="知识点管理"> |
||||
<el-button @click="newKnowledge(staticActions)" type="primary" size="small">新增</el-button> |
||||
<el-table :data="staticActions.knowcourses" style="width: 100%"> |
||||
<el-table-column label="知识点"> |
||||
<template #default="{row}"> |
||||
<el-input v-if="row.read" v-model="row.know"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
{{row.know}} |
||||
</el-col> |
||||
</el-row> |
||||
|
||||
</template> |
||||
</el-table-column> |
||||
|
||||
<el-table-column label="学时"> |
||||
<template #default="{row}"> |
||||
<el-input v-if="row.read" v-model="row.xs"> |
||||
</el-input> |
||||
<el-row v-else :sapn="24"> |
||||
<el-col :span="24"> |
||||
{{row.xs}} |
||||
</el-col> |
||||
</el-row> |
||||
</template> |
||||
</el-table-column> |
||||
<!-- 下拉列表 --> |
||||
<el-table-column label="课程目标"> |
||||
<template #default="{row}"> |
||||
<el-select :disabled="!row.read" v-model="row.kcmbid" filterable placeholder="请选择"> |
||||
<el-option v-for="item in target1" :key="item.id" :label="item.name" :value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" width="100"> |
||||
<template ref="changed" #default="{row}"> |
||||
<el-row> |
||||
<el-col :span="12"> |
||||
<el-button v-if="!row.showDetermine" type="primary" size="mini" @click="[$set(row, 'read', !row.read),$set(row,'showDetermine',!row.showDetermine)] "> |
||||
编辑 |
||||
</el-button> |
||||
<el-button v-if="row.showDetermine" type="primary" size="mini" @click="[submitNew(staticActions,row,id),$set(row,'showDetermine',row.showDetermine)] "> |
||||
确定 |
||||
</el-button> |
||||
</el-col> |
||||
<el-col :span="12"> |
||||
<el-button type="primary" size="mini" @click="deleteShow(row)"> |
||||
删除 |
||||
</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
</template> |
||||
</el-table-column> |
||||
|
||||
</el-table> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="[dialogVisible = false,submitDialog()]">确 定</el-button> |
||||
</span> |
||||
|
||||
</el-dialog> |
||||
<!-- 下一步上一步 --> |
||||
|
||||
<br> |
||||
<div class="sub-down"> |
||||
<a-button @click="setSub">上一步</a-button> |
||||
<a-button @click="setAdd" type="primary">{{setNum==4?'完成':'下一步'}}</a-button> |
||||
</div> |
||||
</el-card> |
||||
|
||||
</div> |
||||
</template> |
||||
<script> |
||||
import CouseTitle from './CouseTitle.vue' |
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage.js' |
||||
|
||||
export default { |
||||
components: { |
||||
CouseTitle, |
||||
}, |
||||
computed: { |
||||
getInfoid() { |
||||
return this.$store.getters.userID |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
staticActions: {}, |
||||
// resultDialog:{}, |
||||
target1: {}, |
||||
dialogVisible: false, |
||||
setNum: 2, |
||||
url: { |
||||
list: '/course/seCourse/listSeChapterByCourseId', |
||||
add: '/knowcourse/knowcourse/add1', |
||||
delete: '/knowcourse/knowcourse/delete', |
||||
course: '/course/seCourse/listByCourseId', |
||||
edit: '/knowcourse/knowcourse/edit1', |
||||
}, |
||||
id: {}, |
||||
formData: [], |
||||
value: '', |
||||
} |
||||
}, |
||||
created() { |
||||
this.showKnowledge() |
||||
this.target() |
||||
}, |
||||
methods: { |
||||
//选择 课程目标 |
||||
async target() { |
||||
const { courseid } = this.$store.getters.userID |
||||
let res = await getAction(this.url.course, { courseid: courseid }) |
||||
this.$set( |
||||
this, |
||||
'target1', |
||||
res.result.map((res) => { |
||||
res.label = res.name |
||||
return res |
||||
}) |
||||
) |
||||
}, |
||||
submitNew(newKnowledge, newKnow) { |
||||
if ( |
||||
newKnowledge.totalclasshours < |
||||
newKnowledge.knowcourses.reduce((item, { xs }) => { |
||||
return (item += Number(xs)) |
||||
}, 0) |
||||
) { |
||||
this.$message.error('超出系统定义学时') |
||||
this.deleteShow(newKnow) |
||||
return |
||||
} |
||||
this.$set(newKnow, 'read', !newKnow.read) |
||||
this.formData.map((res) => { |
||||
res.childChapter.find((resChild) => { |
||||
if (resChild.id == newKnowledge.id) { |
||||
const { courseid, name } = this.$store.getters.userID |
||||
if (newKnow.isValue) { |
||||
newKnow.isValue = false |
||||
postAction(this.url.add, { |
||||
id: '', |
||||
chapterid: res.id, |
||||
uintid: resChild.id, |
||||
kcid: resChild.courseid, |
||||
kcid: courseid, |
||||
kc: name, |
||||
know: newKnow.know, //konw |
||||
xs: newKnow.xs, // |
||||
knowid: '', |
||||
kcmbid: newKnow.kcmbid, // |
||||
kcmb: '', |
||||
}).then((res) => { |
||||
if (res.code != 200) { |
||||
//修改 |
||||
this.deleteShow(newKnow) |
||||
this.$message.error(res.message) |
||||
} else { |
||||
this.showKnowledge() |
||||
this.$message.success(res.message) |
||||
} |
||||
}) |
||||
} else { |
||||
putAction(this.url.edit, { |
||||
id: newKnow.id, |
||||
chapterid: res.id, |
||||
uintid: resChild.id, |
||||
kcid: resChild.courseid, |
||||
kcid: courseid, |
||||
kc: name, |
||||
know: newKnow.know, //konw |
||||
xs: newKnow.xs, // |
||||
knowid: newKnow.knowid, |
||||
kcmbid: newKnow.kcmbid, // |
||||
}).then((res) => { |
||||
if (res.code != 200) { |
||||
//修改 |
||||
this.deleteShow(newKnow) |
||||
this.$message.error(res.message) |
||||
} else { |
||||
this.staticActions = resChild |
||||
this.$message.success(res.message) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
}) |
||||
}, |
||||
//提交的弹窗数据 |
||||
async submitDialog() { |
||||
await postAction(this.url.add, this.staticActions.knowcourses) |
||||
}, |
||||
showKnowledge() { |
||||
this.id = this.$store.getters.userID.courseid |
||||
getAction(this.url.list, { id: this.id }).then((res) => { |
||||
this.$set(this, 'formData', res.result.chapterList) |
||||
}) |
||||
}, |
||||
newKnowledge(newValue) { |
||||
const knowledge = { |
||||
id: '', |
||||
kcid: '', |
||||
kc: '', |
||||
chapterid: '', |
||||
uintid: '', |
||||
kcmbid: '', |
||||
knowid: newValue.knowcourses.length + Date.now(), |
||||
xs: '', |
||||
kcmb: '', |
||||
know: '', |
||||
knowdy: '', |
||||
knowzb: null, |
||||
read: true, |
||||
showDetermine: true, |
||||
isValue: true, |
||||
} |
||||
// |
||||
newValue.knowcourses.push(knowledge) |
||||
//弹窗显示 |
||||
}, |
||||
//删除 |
||||
async deleteShow(row) { |
||||
await deleteAction(this.url.delete, { id: row.id }) |
||||
this.staticActions.knowcourses.find((res, index) => { |
||||
if (res == row) { |
||||
this.$delete(this.staticActions.knowcourses, index) |
||||
} |
||||
}) |
||||
}, |
||||
knowledgeManageDialog(childChapter) { |
||||
this.staticActions = childChapter |
||||
this.dialogVisible = true |
||||
}, |
||||
handleClose(done) { |
||||
this.$confirm('确认关闭?') |
||||
.then((_) => { |
||||
done() |
||||
}) |
||||
.catch((_) => {}) |
||||
}, |
||||
setAdd() { |
||||
if (this.setNum < 3) { |
||||
this.setNum++ |
||||
this.$router.push({ |
||||
path: '/TestWay', |
||||
query:this.$store.getters.userID |
||||
}) |
||||
} |
||||
}, |
||||
// 上一步 |
||||
setSub() { |
||||
if (this.setNum > 0) { |
||||
this.setNum-- |
||||
this.$router.go(-1) |
||||
} |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
||||
<style > |
||||
.el-icon-plus { |
||||
margin: 0 10px; |
||||
} |
||||
.contentSized { |
||||
margin: 10px 20px; |
||||
} |
||||
.PivotContentWC > div { |
||||
text-indent: 5em; |
||||
} |
||||
.align_center { |
||||
display: flex; |
||||
align-items: center; |
||||
margin: 4px 0; |
||||
} |
||||
.sub-down { |
||||
text-align: center; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
} |
||||
.content_list { |
||||
background: whitesmoke; |
||||
height: 30px; |
||||
line-height: 30px; |
||||
margin-bottom: 6px; |
||||
} |
||||
.dialogContent .el-dialog { |
||||
min-width: 450px; |
||||
} |
||||
</style> |
@ -0,0 +1,28 @@ |
||||
package org.jeecg.modules.course.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
|
||||
@Data |
||||
@TableName("assessment_method") |
||||
@ApiModel(value="assessment_method", description="课程考核方式") |
||||
public class SeCoureseType implements Serializable { |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
@ApiModelProperty(value = "过程阶段百分比") |
||||
private String processAssessment; |
||||
@ApiModelProperty(value = "期末考试百分比") |
||||
private String finalExam; |
||||
@ApiModelProperty(value = "课程id") |
||||
@Dict(dicCode = "id", dicText = "name", dictTable = "se_course") |
||||
private String name; |
||||
} |
@ -0,0 +1,9 @@ |
||||
package org.jeecg.modules.course.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.jeecg.modules.course.entity.SeCoureseType; |
||||
|
||||
@Mapper |
||||
public interface SeCourseMethodMapper extends BaseMapper<SeCoureseType> { |
||||
} |
@ -0,0 +1,7 @@ |
||||
package org.jeecg.modules.course.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import org.jeecg.modules.course.entity.SeCoureseType; |
||||
|
||||
public interface ISecourseMethodService extends IService<SeCoureseType> { |
||||
} |
@ -0,0 +1,13 @@ |
||||
package org.jeecg.modules.course.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.jeecg.modules.course.entity.SeCoureseType; |
||||
import org.jeecg.modules.course.entity.SeCourseobjectives; |
||||
import org.jeecg.modules.course.mapper.SeCourseMethodMapper; |
||||
import org.jeecg.modules.course.mapper.SeCourseobjectivesMapper; |
||||
import org.jeecg.modules.course.service.ISecourseMethodService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
public class SeCourseMethod extends ServiceImpl<SeCourseMethodMapper, SeCoureseType> implements ISecourseMethodService { |
||||
} |
Loading…
Reference in new issue