|
@@ -13,21 +13,28 @@
|
|
|
placeholder="请输入描述"></textarea>
|
|
|
</div>
|
|
|
<div class="set_title" style="flex-direction: column;">
|
|
|
- <div @click="openCourse" class="setting">设置课程选择范围</div>
|
|
|
- <!-- {{courses}} -->
|
|
|
+ <div class="title_setting">
|
|
|
+ <span>选择课程:</span>
|
|
|
+ <div @click="openCourse" class="setting">点击添加课程</div>
|
|
|
+ </div>
|
|
|
+ <!-- {{courses}} -->
|
|
|
<div class="set_title_list" v-loading="loading">
|
|
|
- <div v-for="(item,index) in courses" class="set_title_list_item" :key="index" v-if="coursesList.find(i=>i.courseId==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) && coursesList.find(i=>i.courseId==item).title }}</span>
|
|
|
- <span>创建人:{{ coursesList.find(i=>i.courseId==item) && coursesList.find(i=>i.courseId==item).username }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div v-for="(item, index) in courses" class="set_title_list_item" :key="index"
|
|
|
+ v-if="coursesList.find(i => i.courseId == 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) &&
|
|
|
+ coursesList.find(i => i.courseId == item).title }}</span>
|
|
|
+ <span>创建人:{{ coursesList.find(i => i.courseId == item) &&
|
|
|
+ coursesList.find(i => i.courseId == item).username }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <courseDilogVue :dialogVisibleCourse.sync="dialogVisibleCourse" :courses="courses" @setCourse="setCourse"></courseDilogVue>
|
|
|
+ <courseDilogVue :dialogVisibleCourse.sync="dialogVisibleCourse" :courses="courses" @setCourse="setCourse">
|
|
|
+ </courseDilogVue>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -46,16 +53,16 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- loading:false,
|
|
|
- ctype: 1,
|
|
|
- options: [
|
|
|
- { type: 1, name: '附件' },
|
|
|
- // { type: 2, name: '多选题' }
|
|
|
- ],
|
|
|
- checkJson: {},
|
|
|
- dialogVisibleCourse:false,
|
|
|
- courses: [],
|
|
|
- coursesList:[],
|
|
|
+ loading: false,
|
|
|
+ ctype: 1,
|
|
|
+ options: [
|
|
|
+ { type: 1, name: '附件' },
|
|
|
+ // { type: 2, name: '多选题' }
|
|
|
+ ],
|
|
|
+ checkJson: {},
|
|
|
+ dialogVisibleCourse: false,
|
|
|
+ courses: [],
|
|
|
+ coursesList: [],
|
|
|
}
|
|
|
},
|
|
|
directives: {
|
|
@@ -80,17 +87,17 @@ export default {
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
|
- async courses(newValue){
|
|
|
- this.loading = true;
|
|
|
- let result = [];
|
|
|
- let params = {
|
|
|
- cid: this.courses.join(',')
|
|
|
- }
|
|
|
- let data = await this.ajax.get(this.$store.state.api + 'getCourseInfoTestAll',params);
|
|
|
- result = data.data[0]
|
|
|
- this.coursesList = result;
|
|
|
- this.loading = false;
|
|
|
- }
|
|
|
+ async courses(newValue) {
|
|
|
+ this.loading = true;
|
|
|
+ let result = [];
|
|
|
+ let params = {
|
|
|
+ cid: this.courses.join(',')
|
|
|
+ }
|
|
|
+ let data = await this.ajax.get(this.$store.state.api + 'getCourseInfoTestAll', params);
|
|
|
+ result = data.data[0]
|
|
|
+ this.coursesList = result;
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
depthCopy(s) {
|
|
@@ -110,19 +117,19 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
console.log(val);
|
|
|
},
|
|
|
- openCourse(){
|
|
|
+ openCourse() {
|
|
|
this.dialogVisibleCourse = true
|
|
|
},
|
|
|
- setCourse(courses){
|
|
|
+ setCourse(courses) {
|
|
|
this.checkJson.courses = courses
|
|
|
this.courses = courses
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
- // 删除课程
|
|
|
- delCourse(cid){
|
|
|
- let index = this.courses.findIndex(i=>i==cid);
|
|
|
- this.courses.splice(index,1)
|
|
|
- }
|
|
|
+ // 删除课程
|
|
|
+ delCourse(cid) {
|
|
|
+ let index = this.courses.findIndex(i => i == cid);
|
|
|
+ this.courses.splice(index, 1)
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
console.log(1);
|
|
@@ -131,7 +138,7 @@ export default {
|
|
|
this.checkJson = {
|
|
|
title: "标题",
|
|
|
detail: "",
|
|
|
- courses:[]
|
|
|
+ courses: []
|
|
|
};
|
|
|
} else {
|
|
|
this.checkJson = this.depthCopy(this.cJson);
|
|
@@ -233,15 +240,28 @@ export default {
|
|
|
border-top: 10px solid transparent;
|
|
|
} */
|
|
|
|
|
|
-.setting{
|
|
|
+.title_setting{
|
|
|
+ margin-bottom: 10px;
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+}
|
|
|
+
|
|
|
+.title_setting>span{
|
|
|
+ min-width: fit-content;
|
|
|
+ font-size: 15px;
|
|
|
+ min-width: 90px;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+
|
|
|
+.setting {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
cursor: pointer;
|
|
|
- justify-content: flex-end;
|
|
|
+ /* justify-content: flex-end; */
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
-.setting::before{
|
|
|
+.setting::before {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
width: 20px;
|
|
@@ -251,42 +271,42 @@ export default {
|
|
|
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 {
|
|
|
+ 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 {
|
|
|
+ background-color: #d4dde1;
|
|
|
}
|
|
|
|
|
|
-.set_title_list_item:hover>.set_title_list_itemBtn{
|
|
|
- opacity: 1;
|
|
|
+.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_itemBtn {
|
|
|
+ font-size: 18px;
|
|
|
+ margin-right: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ opacity: 0;
|
|
|
}
|
|
|
|
|
|
-.set_title_list_itemLabel{
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
+.set_title_list_itemLabel {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
}
|
|
|
|
|
|
-.set_title_list_itemLabel>span{
|
|
|
- margin-right: 20px;
|
|
|
-}
|
|
|
-.set_title_list{
|
|
|
- min-width: 100%;
|
|
|
- min-height: 200px;
|
|
|
+.set_title_list_itemLabel>span {
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
|
|
|
|
+.set_title_list {
|
|
|
+ min-width: 100%;
|
|
|
+ /* min-height: 200px; */
|
|
|
+}
|
|
|
</style>
|