Explorar el Código

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

JAELYS hace 4 años
padre
commit
e40a045e1c

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

@@ -179,9 +179,6 @@
                             <div>
                                 <EmptyData v-if="questionList.length == 0"></EmptyData>
                             </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>-->
                         <ExerciseList></ExerciseList>
                     </vuescroll>
@@ -225,7 +222,6 @@
             return {
                 questionList: [],
                 pageNum: 1,
-                totalNum: 0,
                 pageSize: 20,
                 questionConfig: {
                     showSelect: true
@@ -388,9 +384,6 @@
                         'field': [],
                     }
                 }
-                this.$api.newEvaluation.FindCount(findCountParams).then(res => {
-                    this.totalNum = res.result.data[0]
-                })
             },
             /**
              * 选择学科、学段后刷新

+ 1 - 6
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTest.vue

@@ -366,7 +366,6 @@
             opentestWithSubject(item) {
                 console.log(item)
                 if (item.code !== '') {
-                    console.log('5645645646354')
                     this.getPaper(item)
                 }
             },
@@ -380,16 +379,12 @@
                         code: key[(key.length - 1)],
                         blob: data.blob
                     }
-                    //let code = {
-                    //    scope: 'school',
-                    //    code: 'hbcn',
-                    //    blob: "/paper/预设试卷名称"
-                    //}
                     this.selectData = await this.$evTools.getStuPaper(code)
                     console.log(this.selectData)
                     if (this.selectData.item.length > 0) {
                         this.$store.commit("ToggleLessonTestPopWithSubject", data)
                         this.$store.commit("SetPaperInfo", this.selectData)
+                        this.$store.commit("SetExamInfo", data)
                     }
                 }
             },

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 51 - 35
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestPop.vue


+ 94 - 81
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/composePaper.vue

@@ -5,93 +5,106 @@
 </template>
 <script>
     import E from 'wangeditor'
-	export default {
-		components: {
+    export default {
+        components: {
 
         },
         props: {
-            index:""
+            index: {
+                type: Number,
+                default: -1
+            },
+            textData: {
+                type: Array,
+                default: () => {
+                    return []
+                }
+            }
         },
-		data() {
-			return {
-				tabName: 'exercise',
-                editorContent:""
-			}
-		},
-		created() {
-
-		},
-		methods: {
+        data() {
+            return {
+                tabName: 'exercise',
+                editorContent: "",
+                examInfo: [],
+                editor: null
+            }
+        },
+        created() {
 
-		},
-		mounted() {
-            var editor = new E("#textArea");
-            editor.customConfig.onchange = html => {
-                this.editorContent = html;
-                if (this.editorContent !== "") {
-                    console.log('454564164556')
-                    this.$emit("change", this.editorContent,this.index)
+        },
+        methods: {
+            getInfo() {
+                this.initEditor()
+                this.examInfo = []
+                console.log('变化数据')
+                console.log(this.textData)
+                if (this.textData.length > 0) {
+                    this.examInfo = [...this.textData]
+                        this.editor.txt.html(this.examInfo[0])
                 }
-            };
-            editor.customConfig.menus = [
-                "fontSize", // 字号
-                "fontName", // 字体
-                "italic", // 斜体
-                "underline", // 下划线
-                "link", // 插入链接
-                "justify", // 对齐方式
-                "quote", // 引用
-                "emoticon", // 表情
-                "image", // 插入图片
-                "video", // 插入视频
-                "undo", // 撤销
-                "redo" // 重复
-            ]
-            editor.customConfig.zIndex = 1
-            //// 选项编辑器失焦隐藏工具栏
-            //editor.customConfig.onblur = function () {
-            //    let allToolbars = document.getElementsByClassName('textArea')
-            //    for (let i = 0; i < allToolbars.length; i++) {
-            //        if (allToolbars[i].children.length) {
-            //            allToolbars[i].children[0].style.visibility = 'hidden'
-            //        }
-            //    }
-            //}
-            editor.customConfig.linkImgCallback = function (url) {
-                console.log(url); // url 即插入图片的地址
-            };
-            editor.customConfig.linkCheck = function (text, link) {
-                console.log(text); // 插入的文字
-                console.log(link); // 插入的链接
-                return true; // 返回 true 表示校验成功
-            };
-            // 自定义配置颜色(字体颜色、背景色)
-            editor.customConfig.colors = [
-                "#000000",
-                "#eeece0",
-                "#1c487f",
-                "#4d80bf",
-                "#c24f4a",
-                "#8baa4a",
-                "#7b5ba1",
-                "#46acc8",
-                "#f9963b",
-                "#ffffff"
-            ];
-            // 自定义字体
-            editor.customConfig.fontNames = [
-                "宋体",
-                "微软雅黑",
-                "Verdana"
-            ];
-            // 隐藏“网络图片”tab
-            editor.customConfig.showLinkImg = false;
-            // 下面两个配置,使用其中一个即可显示“上传图片”的tab。但是两者不要同时使用!!!
-            editor.customConfig.uploadImgShowBase64 = true; // 使用 base64 保存图片不建议使用这种,我只是图个方便
-            // editor.customConfig.uploadImgServer = '/upload'  // 上传图片到服务器
-            editor.create();
-
-		}
+                console.log(this.textData)
+            },
+            initEditor() {
+                this.editorContent = ""
+                this.editor = new E("#textArea");
+                this.editor.customConfig.onchange = html => {
+                    this.editorContent = html;
+                    if (this.editorContent !== "") {
+                        this.$emit("dataChange", this.editorContent, this.index)
+                    }
+                };
+                this.editor.customConfig.menus = [
+                    "fontSize", // 字号
+                    "fontName", // 字体
+                    "italic", // 斜体
+                    "underline", // 下划线
+                    "link", // 插入链接
+                    "justify", // 对齐方式
+                    "quote", // 引用
+                    "emoticon", // 表情
+                    "image", // 插入图片
+                    "video", // 插入视频
+                    "undo", // 撤销
+                    "redo" // 重复
+                ]
+                this.editor.customConfig.zIndex = 1
+                this.editor.customConfig.linkImgCallback = function (url) {
+                    console.log(url); // url 即插入图片的地址
+                };
+                this.editor.customConfig.linkCheck = function (text, link) {
+                    console.log(text); // 插入的文字
+                    console.log(link); // 插入的链接
+                    return true; // 返回 true 表示校验成功
+                };
+                // 自定义字体
+                this.editor.customConfig.fontNames = [
+                    "宋体",
+                    "微软雅黑",
+                    "Verdana"
+                ];
+                this.editor.customConfig.showLinkImg = false;
+                // 下面两个配置,使用其中一个即可显示“上传图片”的tab。但是两者不要同时使用!!!
+                this.editor.customConfig.uploadImgShowBase64 = true; // 使用 base64 保存图片不建议使用这种,我只是图个方便
+                // editor.customConfig.uploadImgServer = '/upload'  // 上传图片到服务器
+                this.editor.create();
+                this.editor.txt.clear()
+                if (this.examInfo.length > 0) {
+                    this.editor.txt.html(this.examInfo[0])
+                } 
+            }
+        },
+        mounted() {
+            this.initEditor()
+            this.getInfo()
+        },
+        watch: {
+            index() {
+                console.log(this.index)
+                this.getInfo()
+                deep: true;
+                immediate:true
+            }
+        }
 	}
 </script>
 <style>

+ 1 - 0
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue

@@ -640,6 +640,7 @@
             },
 
             sentSelectedEventTitle(item) {
+                console.log(item)
                 this.$router.push({
                     path: "/studentWeb/eventView",
                     query: {

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

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

+ 11 - 0
TEAMModelOS/ClientApp/src/store/module/studentWeb.js

@@ -25,6 +25,7 @@ export default {
         },
         paperInfo: {},
         Item: {}, //存放活動相關的狀態
+        examInfo: {},
         tempfinishedItem: [], //用來暫存目前完成的項目ID
         tempfinishedItemtime: [],
         CountedIsDonePercent: myMockData.initialfinishResult, //存放活動完成度值,初始值先從Api抓資料,後續透過vuex抓狀態變化
@@ -138,8 +139,15 @@ export default {
             state.currentQuestionNo = no;
         },
         SetPaperInfo(state, data) {
+            console.log('存入数据')
+            console.log(data)
             state.paperInfo = data
         },
+        SetExamInfo(state, data) {
+            console.log('存入数据')
+            console.log(data)
+            state.examInfo = data
+        },
         SetTrytestCount(state, nowCountArray) {
             state.trytestCount = nowCountArray;
             //console.log("目前單元嘗試次數" + state.trytestCount);
@@ -307,6 +315,9 @@ export default {
         getPaperInfo: (state) => {
             return state.paperInfo;
         },
+        getExamInfo: (state) => {
+            return state.examInfo;
+        },
         getSidebarisOpen: (state) => {
             return state.sideBarIsOpen;
         },

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

@@ -105,7 +105,7 @@
                class-name="dark-iview-modal"
                @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" >
                         <span>{{subjectItem.name}}</span>
                     </Checkbox>
@@ -301,7 +301,7 @@
         },
         methods: {
             //设置学科名称
-            setSubjectName(data) {
+            setSubjectName() {
                 this.evaluationInfo.subjects = this.curSubjects.filter(item => {
                     return this.evaluationInfo.subjectIds.indexOf(item.id) >= 0 
                 })
@@ -428,21 +428,33 @@
                 })
             },
             confirmAddSubject() {
+                this.setSubjectName()
+                //查看是否已有对应学科试卷
                 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>
                                                 <Input v-model="item.name" :disabled="editSemIndex !== index" placeholder="设置学期..." style="width: 180px" />
                                             </p>
+                                            <p>{{item.month}}</p>
                                             <div class="term-item-start" @click.stop>
                                                 <span>{{$t('schoolBaseInfo.startDate')}}</span>
                                                 <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" />
         </Modal>
     </div>
-
 </template>
 
 <script>
@@ -234,7 +234,6 @@
                     name: '',
                     id: ''
                 },
-
                 delSubStatus: false,
                 delAnaStatus: false,
                 delGraStatus: false,
@@ -540,7 +539,6 @@
                     }
                     //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count ? count : 365)
                     this.semDays.push(count ? count : 365)
-                    this.updated = false
                 }
             },
             /**
@@ -609,7 +607,7 @@
                 this.curSemIndex = 0
                 this.curPriodIndex = index
                 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
                         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 d = this.getDays(sDate, eDate)
                                             count -= d
-                                            //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[i], 'days', d)
                                             this.semDays.push(d)
                                         }
                                     }
-                                    //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count)
                                     this.semDays.push(count)
                                 }
-                                this.updated = false
                             }
                         } else {
                             this.getLocalDefaultData()
@@ -834,10 +829,14 @@
         watch: {
             schoolSetting: {
                 handler(newValue, oldValue) {
+                    console.log('n', newValue)
+                    console.log('o', oldValue)
+                    console.log(this.isInit)
                     if (this.isInit) {
                         this.isInit = false
                     } else {
                         this.updated = true
+                        console.log('变了')
                     }
                 },
                 deep: true
@@ -851,18 +850,11 @@
             this.getMonthList()
         },
         beforeRouteLeave(to, from, next) {
-            if (this.updated == true) {
+            if (this.updated) {
                 let config = {
-                    render: (h) => {
-                        return h('h3', {
-                            style: {
-                                textAlign: 'center'
-                            },
-                            domProps: {
-                                innerText: this.$t('schoolBaseInfo.ssTips8')
-                            }
-                        })
-                    },
+                    title: '保存提醒',
+                    content: this.$t('schoolBaseInfo.ssTips8'),
+                    okText:'离开',
                     onOk: () => {
                         next()
                     },
@@ -879,7 +871,6 @@
             this.colorList = ['#F16C6A', '#68CDF1', '#7C4DFF', '#00796B',   '#D32F2F', '#0288D1', '#D32F2F', '#00796B', '#7C4DFF', '#0288D1']
         },
         computed: {
-
             //计算时区设置宽度
             tzWidth() {
                 if (this.schoolSetting.timeZone && this.schoolSetting.timeZone.label) {