Pārlūkot izejas kodu

处理创建评测学科新增和删除逻辑,处理区班校bug

liqk 4 gadi atpakaļ
vecāks
revīzija
0065eb97be

+ 0 - 7
TEAMModelOS/ClientApp/src/components/selflearn/NewChooseContent.vue

@@ -179,9 +179,6 @@
                             <div>
                             <div>
                                 <EmptyData v-if="questionList.length == 0"></EmptyData>
                                 <EmptyData v-if="questionList.length == 0"></EmptyData>
                             </div>-->
                             </div>-->
-                            <!--<div class="page-wrap">
-                                <Page :current.sync="pageNum" :total="totalNum" :page-size="pageSize" size="small" show-total show-sizer @on-change="getCurrentPageData" />
-                            </div>-->
                         <!--</div>-->
                         <!--</div>-->
                         <ExerciseList></ExerciseList>
                         <ExerciseList></ExerciseList>
                     </vuescroll>
                     </vuescroll>
@@ -225,7 +222,6 @@
             return {
             return {
                 questionList: [],
                 questionList: [],
                 pageNum: 1,
                 pageNum: 1,
-                totalNum: 0,
                 pageSize: 20,
                 pageSize: 20,
                 questionConfig: {
                 questionConfig: {
                     showSelect: true
                     showSelect: true
@@ -388,9 +384,6 @@
                         'field': [],
                         'field': [],
                     }
                     }
                 }
                 }
-                this.$api.newEvaluation.FindCount(findCountParams).then(res => {
-                    this.totalNum = res.result.data[0]
-                })
             },
             },
             /**
             /**
              * 选择学科、学段后刷新
              * 选择学科、学段后刷新

+ 18 - 6
TEAMModelOS/ClientApp/src/static/baseDataDefault.json

@@ -24,11 +24,15 @@
         "semesters": [
         "semesters": [
             {
             {
                 "name": "上学期",
                 "name": "上学期",
-                "id": "1"
+                "id": "1",
+                "month": 1,
+                "day": 1
             },
             },
             {
             {
                 "name": "下学期",
                 "name": "下学期",
-                "id": "2"
+                "id": "2",
+                "month": 2,
+                "day": 1
             }
             }
         ]
         ]
     },
     },
@@ -54,11 +58,15 @@
         "semesters": [
         "semesters": [
             {
             {
                 "name": "上學期",
                 "name": "上學期",
-                "id": "1"
+                "id": "1",
+                "month": 1,
+                "day": 1
             },
             },
             {
             {
                 "name": "下學期",
                 "name": "下學期",
-                "id": "2"
+                "id": "2",
+                "month": 2,
+                "day": 1
             }
             }
         ]
         ]
     },
     },
@@ -87,11 +95,15 @@
         "semesters": [
         "semesters": [
             {
             {
                 "name": "Last semester",
                 "name": "Last semester",
-                "id": "1"
+                "id": "1",
+                "month": 1,
+                "day": 1
             },
             },
             {
             {
                 "name": "Next semester",
                 "name": "Next semester",
-                "id": "2"
+                "id": "2",
+                "month": 2,
+                "day": 1
             }
             }
         ]
         ]
     }
     }

+ 27 - 15
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue

@@ -105,7 +105,7 @@
                class-name="dark-iview-modal"
                class-name="dark-iview-modal"
                @on-ok="confirmAddSubject"
                @on-ok="confirmAddSubject"
                >
                >
-                <CheckboxGroup v-model="evaluationInfo.subjectIds" style="color:white;" @on-change="setSubjectName">
+                <CheckboxGroup v-model="evaluationInfo.subjectIds" style="color:white;">
                     <Checkbox v-for="(subjectItem,index) in curSubjects" :key="index" :label="subjectItem.id" >
                     <Checkbox v-for="(subjectItem,index) in curSubjects" :key="index" :label="subjectItem.id" >
                         <span>{{subjectItem.name}}</span>
                         <span>{{subjectItem.name}}</span>
                     </Checkbox>
                     </Checkbox>
@@ -301,7 +301,7 @@
         },
         },
         methods: {
         methods: {
             //设置学科名称
             //设置学科名称
-            setSubjectName(data) {
+            setSubjectName() {
                 this.evaluationInfo.subjects = this.curSubjects.filter(item => {
                 this.evaluationInfo.subjects = this.curSubjects.filter(item => {
                     return this.evaluationInfo.subjectIds.indexOf(item.id) >= 0 
                     return this.evaluationInfo.subjectIds.indexOf(item.id) >= 0 
                 })
                 })
@@ -428,21 +428,33 @@
                 })
                 })
             },
             },
             confirmAddSubject() {
             confirmAddSubject() {
+                this.setSubjectName()
+                //查看是否已有对应学科试卷
                 for (let item of this.evaluationInfo.subjects) {
                 for (let item of this.evaluationInfo.subjects) {
-                    let periodData = this.schoolBase.period.filter((item)=> {
-                        return item.id == this.evaluationInfo.period.id
-                    })
-                    this.evaluationInfo.paperInfo.push({
-                        periodName: periodData.name,
-                        periodId: periodData.id,
-                        subjectName: item.name,
-                        subjectId: item.id,
-                        createType: 'manualPaper',
-                        score: 100,
-                        item: [],
-                        filter: {},
-                        name: this.evaluationInfo.name + '--' + item.name
+                    let f = this.evaluationInfo.paperInfo.find(paper => {
+                        return paper.subjectId == item.id
                     })
                     })
+                    if (!f) {
+                        this.evaluationInfo.paperInfo.push({
+                            periodName: this.evaluationInfo.name,
+                            periodId: this.evaluationInfo.id,
+                            subjectName: item.name,
+                            subjectId: item.id,
+                            createType: 'manualPaper',
+                            score: 100,
+                            item: [],
+                            filter: {},
+                            name: this.evaluationInfo.name + '--' + item.name
+                        })
+                    }
+                }
+                //处理取消选择学科逻辑
+                for (let i = 0; i < this.evaluationInfo.paperInfo.length; i++) {
+                    let subId = this.evaluationInfo.paperInfo[i].subjectId
+                    if (this.evaluationInfo.subjectIds.indexOf(subId) < 0) {
+                        this.evaluationInfo.paperInfo.splice(i, 1)
+                        i--
+                    }
                 }
                 }
             },
             },
             /**
             /**

+ 10 - 19
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -59,6 +59,7 @@
                                             <p class="semester-name-label" @click.stop>
                                             <p class="semester-name-label" @click.stop>
                                                 <Input v-model="item.name" :disabled="editSemIndex !== index" placeholder="设置学期..." style="width: 180px" />
                                                 <Input v-model="item.name" :disabled="editSemIndex !== index" placeholder="设置学期..." style="width: 180px" />
                                             </p>
                                             </p>
+                                            <p>{{item.month}}</p>
                                             <div class="term-item-start" @click.stop>
                                             <div class="term-item-start" @click.stop>
                                                 <span>{{$t('schoolBaseInfo.startDate')}}</span>
                                                 <span>{{$t('schoolBaseInfo.startDate')}}</span>
                                                 <Select v-model="item.month" style="width:50px" placeholder="月" :disabled="editSemIndex !== index">
                                                 <Select v-model="item.month" style="width:50px" placeholder="月" :disabled="editSemIndex !== index">
@@ -216,7 +217,6 @@
             <Icon type="md-add-circle" size="40" style="margin:auto;cursor:pointer;margin-top:30px;" @click="addCampus" />
             <Icon type="md-add-circle" size="40" style="margin:auto;cursor:pointer;margin-top:30px;" @click="addCampus" />
         </Modal>
         </Modal>
     </div>
     </div>
-
 </template>
 </template>
 
 
 <script>
 <script>
@@ -234,7 +234,6 @@
                     name: '',
                     name: '',
                     id: ''
                     id: ''
                 },
                 },
-
                 delSubStatus: false,
                 delSubStatus: false,
                 delAnaStatus: false,
                 delAnaStatus: false,
                 delGraStatus: false,
                 delGraStatus: false,
@@ -540,7 +539,6 @@
                     }
                     }
                     //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count ? count : 365)
                     //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count ? count : 365)
                     this.semDays.push(count ? count : 365)
                     this.semDays.push(count ? count : 365)
-                    this.updated = false
                 }
                 }
             },
             },
             /**
             /**
@@ -609,7 +607,7 @@
                 this.curSemIndex = 0
                 this.curSemIndex = 0
                 this.curPriodIndex = index
                 this.curPriodIndex = index
                 for (let item in this.schoolSetting.campuses) {
                 for (let item in this.schoolSetting.campuses) {
-                    if (this.schoolSetting.campuses[item].campusId === this.schoolSetting.period[this.curPriodIndex].campusId) {
+                    if (this.schoolSetting.campuses[item].campusId == this.schoolSetting.period[this.curPriodIndex].campusId) {
                         this.selectedCampusIndex = item
                         this.selectedCampusIndex = item
                         break
                         break
                     }
                     }
@@ -695,14 +693,11 @@
                                             let eDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].day
                                             let eDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].day
                                             let d = this.getDays(sDate, eDate)
                                             let d = this.getDays(sDate, eDate)
                                             count -= d
                                             count -= d
-                                            //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[i], 'days', d)
                                             this.semDays.push(d)
                                             this.semDays.push(d)
                                         }
                                         }
                                     }
                                     }
-                                    //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count)
                                     this.semDays.push(count)
                                     this.semDays.push(count)
                                 }
                                 }
-                                this.updated = false
                             }
                             }
                         } else {
                         } else {
                             this.getLocalDefaultData()
                             this.getLocalDefaultData()
@@ -834,10 +829,14 @@
         watch: {
         watch: {
             schoolSetting: {
             schoolSetting: {
                 handler(newValue, oldValue) {
                 handler(newValue, oldValue) {
+                    console.log('n', newValue)
+                    console.log('o', oldValue)
+                    console.log(this.isInit)
                     if (this.isInit) {
                     if (this.isInit) {
                         this.isInit = false
                         this.isInit = false
                     } else {
                     } else {
                         this.updated = true
                         this.updated = true
+                        console.log('变了')
                     }
                     }
                 },
                 },
                 deep: true
                 deep: true
@@ -851,18 +850,11 @@
             this.getMonthList()
             this.getMonthList()
         },
         },
         beforeRouteLeave(to, from, next) {
         beforeRouteLeave(to, from, next) {
-            if (this.updated == true) {
+            if (this.updated) {
                 let config = {
                 let config = {
-                    render: (h) => {
-                        return h('h3', {
-                            style: {
-                                textAlign: 'center'
-                            },
-                            domProps: {
-                                innerText: this.$t('schoolBaseInfo.ssTips8')
-                            }
-                        })
-                    },
+                    title: '保存提醒',
+                    content: this.$t('schoolBaseInfo.ssTips8'),
+                    okText:'离开',
                     onOk: () => {
                     onOk: () => {
                         next()
                         next()
                     },
                     },
@@ -879,7 +871,6 @@
             this.colorList = ['#F16C6A', '#68CDF1', '#7C4DFF', '#00796B',   '#D32F2F', '#0288D1', '#D32F2F', '#00796B', '#7C4DFF', '#0288D1']
             this.colorList = ['#F16C6A', '#68CDF1', '#7C4DFF', '#00796B',   '#D32F2F', '#0288D1', '#D32F2F', '#00796B', '#7C4DFF', '#0288D1']
         },
         },
         computed: {
         computed: {
-
             //计算时区设置宽度
             //计算时区设置宽度
             tzWidth() {
             tzWidth() {
                 if (this.schoolSetting.timeZone && this.schoolSetting.timeZone.label) {
                 if (this.schoolSetting.timeZone && this.schoolSetting.timeZone.label) {