|
@@ -14,9 +14,16 @@
|
|
|
</div>
|
|
|
<div class="set_title" style="flex-direction: column;">
|
|
|
<div @click="openCourse" class="setting">设置课程选择范围</div>
|
|
|
- <div>
|
|
|
- <div>cid</div>
|
|
|
- <div>cid</div>
|
|
|
+ <!-- {{courses}} -->
|
|
|
+ <div class="set_title_list">
|
|
|
+ <div v-for="(item,index) in courses" class="set_title_list_item">
|
|
|
+ <!-- {{ `课程名称:${item.title} 创建人:${item.username}`}} -->
|
|
|
+ <div class="set_title_list_itemBtn el-icon-remove-outline" @click.stop="delCourse(item)"></div>
|
|
|
+ <div class="set_title_list_itemLabel">
|
|
|
+ <span>课程名称:{{ coursesList.find(i=>i.courseId==item).title }}</span>
|
|
|
+ <span>创建人:{{ coursesList.find(i=>i.courseId==item).username }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -46,7 +53,8 @@ export default {
|
|
|
],
|
|
|
checkJson: {},
|
|
|
dialogVisibleCourse:false,
|
|
|
- courses: []
|
|
|
+ courses: [],
|
|
|
+ coursesList:[],
|
|
|
}
|
|
|
},
|
|
|
directives: {
|
|
@@ -70,7 +78,22 @@ export default {
|
|
|
this.$emit("setJson", newVal)
|
|
|
},
|
|
|
deep: true
|
|
|
- }
|
|
|
+ },
|
|
|
+ courses(newValue){
|
|
|
+ let result = [];
|
|
|
+ newValue.forEach(async (item,index)=>{
|
|
|
+ let params = {
|
|
|
+ cid: item
|
|
|
+ }
|
|
|
+
|
|
|
+ let data = await this.ajax.get(this.$store.state.api + 'getCourseInfoTest',params);
|
|
|
+ console.log(data)
|
|
|
+ result.push(data.data[0][0]);
|
|
|
+ if(result.length-1==index){
|
|
|
+ this.coursesList = result;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
depthCopy(s) {
|
|
@@ -97,7 +120,12 @@ export default {
|
|
|
this.checkJson.courses = courses
|
|
|
this.courses = courses
|
|
|
this.$forceUpdate()
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 删除课程
|
|
|
+ delCourse(cid){
|
|
|
+ let index = this.courses.findIndex(i=>i==cid);
|
|
|
+ this.courses.splice(index,1)
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
console.log(1);
|
|
@@ -225,4 +253,39 @@ export default {
|
|
|
background-size: 100% 100%;
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
+
|
|
|
+.set_title_list_item{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: auto;
|
|
|
+ height: 40px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 0 20px
|
|
|
+}
|
|
|
+
|
|
|
+.set_title_list_item:hover{
|
|
|
+ background-color: #d4dde1;
|
|
|
+}
|
|
|
+
|
|
|
+.set_title_list_item:hover>.set_title_list_itemBtn{
|
|
|
+ opacity: 1;
|
|
|
+}
|
|
|
+
|
|
|
+.set_title_list_itemBtn{
|
|
|
+ font-size: 18px;
|
|
|
+ margin-right: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ opacity: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.set_title_list_itemLabel{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.set_title_list_itemLabel>span{
|
|
|
+ margin-right: 20px;
|
|
|
+}
|
|
|
+
|
|
|
</style>
|