浏览代码

对接删除课程API

liqk 4 年之前
父节点
当前提交
a3ae1836df

+ 3 - 4
TEAMModelOS/ClientApp/src/view/newcourse/ManageCourse.vue

@@ -374,7 +374,7 @@
                                     }
                                     this.keyWord = ''
                                     this.searchCourse()
-                                    
+                                    this.teacherId = []
                                 } else {
                                     this.$Message.error('API ERROR!')
                                 }
@@ -400,11 +400,10 @@
                     this.tableHeight = dom[0].offsetHeight - 20
                 }
             })
+            this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
+            })
             this.$store.dispatch('teachers/getTeacherList').then(res => {
             })
-        },
-        mounted() {
-            
         }
     }
 </script>

+ 4 - 3
TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue

@@ -39,7 +39,7 @@
                 <Button style="float:right;margin-right:10px;margin-top:6px;" :loading="isLoading" :disabled="!updated" icon="ios-albums-outline" @click="saveCusPlan()">
                     {{$t('schoolBaseInfo.saveInfo')}}
                 </Button>
-                <Button style="float:right;margin-right:10px;margin-top:6px;" :disabled="0" @click="showImportCus" icon="md-arrow-round-up">导入安排</Button>
+                <Button style="float:right;margin-right:10px;margin-top:6px;" :disabled="true" @click="showImportCus" icon="md-arrow-round-up">导入安排</Button>
             </div>
             <div class="cus-table-content dark-iview-select">
                 <vuescroll>
@@ -98,7 +98,6 @@
     </div>
 </template>
 <script>
-
     import ImportExcel from '@/common/ImportExcel.vue'
     export default {
         components: {
@@ -297,6 +296,8 @@
                 this.importData.length = 0
             },
             selectClass(index) {
+                console.log('0.0.0.0')
+                console.log(this.classListShow[index])
                 if (!this.classListShow[index].cusSetting) {
                     this.findClassPlan(index)
                 }
@@ -344,7 +345,7 @@
             this.isLoading = true
             await this.getCourseList()
             await this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
-                this.classList = this.$store.state.schoolBaseInfo.classroomList
+                this.classList = JSON.parse(JSON.stringify(this.$store.state.schoolBaseInfo.classroomList))
                 this.classListShow = [...this.classList]
                 this.findClassPlan(0)
                 this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo

+ 4 - 1
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -139,11 +139,14 @@
                                     <Icon type="md-create" class="action-btn-icon" @click.stop="editAnaStatus = !editAnaStatus" v-if="$access.ability('admin','schoolSetting-upd').validateAll" />
                                 </div>
                                 <div class="attr-box-item" style="margin-top:15px;">
+                                    <p>
+                                        <span>考试类型:</span>
+                                    </p>
                                     <div class="attr-content">
                                         <div class="tag-item item-active" @click.stop v-for="(item,index) in schoolSetting.period[curPriodIndex].analysis.type" :key="index">
                                             <!--<span class="tag-item-icon"></span>-->
                                             <Input v-model="item.name" :disabled="!editAnaStatus" placeholder="设置考试类型..." :style="{width: getWidth(index,item.name)+'px'}" />
-                                            <Icon type="md-close" @click="confirmDelAna(index,typeIndex)" v-show="delAnaStatus" />
+                                            <Icon type="md-close" @click="confirmDelAna(index)" v-show="delAnaStatus" />
                                         </div>
                                     </div>
                                 </div>

+ 5 - 2
TEAMModelOS/Controllers/School/CourseController.cs

@@ -265,7 +265,7 @@ namespace TEAMModelOS.Controllers
                     {
                         for (int j = 0; j < managements[i].courses.Count; j++)
                         {                      
-                            if (!managements[i].courses[j].course.id.Equals(request.ids[k].ToString()))
+                            if (managements[i].courses[j].course.id.Equals(request.ids[k].ToString()))
                             {
                                 managements[i].courses.Remove(managements[i].courses[j]);
                                 flag = true;
@@ -415,8 +415,11 @@ namespace TEAMModelOS.Controllers
                 var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(requert.id, new PartitionKey($"{requert.code}"));
                 if (response.Status == 200)
                 {
+/*                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    CourseManagement courseManagement = json.ToObject<CourseManagement>();
+                    courseManagement.courses = requert.courses;*/
                     //return Ok(new { error = ResponseCode.DATA_EXIST, V = "课程编码已经存在!" });
-                    course = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(requert, new PartitionKey($"{requert.code}"));
+                    course = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").ReplaceItemAsync(requert,requert.id, new PartitionKey($"{requert.code}"));
 
                 }
                 else