Prechádzať zdrojové kódy

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

CrazyIter_Bin 4 rokov pred
rodič
commit
d701ccc476

+ 1 - 1
TEAMModelFunction/TriggerExam.cs

@@ -367,7 +367,7 @@ namespace TEAMModelFunction
                     //先与第一个值取并集
                     if (examResults.Count > 0)
                     {
-                        losStu.Union(examResults[0].lostStus);
+                        losStu = losStu.Union(examResults[0].lostStus).ToList();
                         foreach (ExamResult examResult in examResults)
                         {
                             if (info.id == examResult.examId)

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/schoolBaseInfo.js

@@ -1,7 +1,7 @@
 export default {
   // SystemSetting.vue
   schoolNameLabel: '学校名称:',
-  periodSettingLabel: '学制设置',
+  periodSettingLabel: '学制',
   order: '依建立时间排序',
   semesterSetting: '学期(季)设置',
   gradeSetting: '年级设置',
@@ -62,7 +62,7 @@ export default {
   delCampusTitle: '删除校区',
   delSmTitle: '删除学期',
   delContent: '后与之关联的数据将不能查询,确认删除吗?',
-  campusWarning: '对不起,校区数量已到系统授权最多数量!',
+  campusWarning: '对不起,学制/学院数量已到系统授权最多数量!',
   authWarning: '您暂无此操作权限!',
   saveErr: '保存失败!',
   saveWarning: '保存提醒',

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/schoolBaseInfo.js

@@ -1,7 +1,7 @@
 export default {
   //SystemSetting.vue
   schoolNameLabel: '學校名稱:',
-  periodSettingLabel: '學制設定',
+  periodSettingLabel: '學制',
   order: '依建立時間排序',
   semesterSetting: '學期(季)設定',
   gradeSetting: '年級設定',
@@ -62,7 +62,7 @@ export default {
   delCampusTitle: '删除校區',
   delSmTitle: '删除學期',
   delContent: '後與之關聯的數據將不能査詢,確認删除嗎?',
-  campusWarning: '對不起,校區數量已到系統授權最多數量!',
+  campusWarning: '對不起,學制/學院數量已到系統授權最多數量!',
   authWarning: '您暫無此操作許可權!',
   saveErr: '保存失敗!',
   saveWarning: '保存提醒',

+ 1 - 0
TEAMModelOS/ClientApp/src/router/routes.js

@@ -221,6 +221,7 @@ export const routes = [
 				activeName: 'system'
 			},
 			component: resolve => require(['@/view/schoolmgmt/SystemSetting/SystemSetting.vue'], resolve)
+			// component: resolve => require(['@/view/schoolmgmt/SystemSetting/NewSystemSetting.vue'], resolve)
 		},
 		//班级教室管理
 		{

+ 3 - 3
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -76,10 +76,10 @@
                             </div>
                             <!-- 加分 减分 -->
                             <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
-                                <span class="fast-score-tag" @click="scoreUp((getScoreIndex(typeIndex,index)),item.score)">
+                                <span class="fast-score-tag" @click="scoreUp(item.index,item.score)">
                                     <Icon type="md-add" />
                                 </span>
-                                <span class="fast-score-tag" @click="scoreDown(getScoreIndex(typeIndex,index))" style="background:#ed4014">
+                                <span class="fast-score-tag" @click="scoreDown(item.index)" style="background:#ed4014">
                                     <Icon type="md-remove" />
                                 </span>
                             </div>
@@ -202,7 +202,7 @@
                                 </div>
                                 <!-- 加分 减分 -->
                                 <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
-                                    <span class="fast-score-tag" @click="scoreUp(childItem.index,item.score)">
+                                    <span class="fast-score-tag" @click="scoreUp(childItem.index,childItem.score)">
                                         <Icon type="md-add" />
                                     </span>
                                     <span class="fast-score-tag" @click="scoreDown(childItem.index)" style="background:#ed4014">

+ 233 - 0
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/NewSystemSetting.less

@@ -0,0 +1,233 @@
+@nothing-textColor: #5f5f5f;
+@large-fontSize: 20px;
+
+
+.sm-system {
+    width: 100%;
+    height: 100%;
+    color: white;
+}
+.sm {
+    &-school-name {
+        height: 50px;
+        border-bottom: 1px solid #606060;
+
+        .setting-title {
+            color: var(--label-text-color);
+            font-size: var(--font-size-normal);
+            font-weight: bold;
+            line-height: 50px;
+            margin-right: 5px;
+            margin-left: 16px;
+        }
+
+        .school-name {
+            font-size: var(--font-size-normal);
+            color: var(--primary-text-color);
+        }
+
+        .school-tools {
+            font-size: var(--font-size-normal);
+            margin-right: 30px;
+            margin-top: 8px;
+            float: right;
+        }
+
+        .school-tools .ivu-icon {
+            font-size: @font-size-large;
+            margin-right: 5px;
+            vertical-align: text-top;
+        }
+    }
+}
+
+.sm-system {
+    &-body {
+        height:~"calc(100% - 50px)";
+        width: 100%;
+        user-select: none !important;
+    }
+    .col-title {
+        .action-btn-icon{
+            float:right;
+            line-height:40px;
+            color:white;
+            margin-left:8px;
+            font-size:16px;
+            &:hover{
+                color:aqua;
+            }
+        }
+        height: 40px;
+        line-height:40px;
+        width: 100%;
+        padding: 0 10px 0 0px;
+        font-size: var(--font-size-normal);
+        color: var(--label-text-color);
+        border-bottom: 1px solid var(--border-color);
+
+        .ivu-icon {
+            color: var(--primary-text-color);
+            cursor: pointer;
+            margin-right: 10px;
+        }
+    }
+}
+
+.editable {
+    display:inline-block;
+    &:hover {
+        .edit-btn {
+            display: inline-block;
+        }
+    }
+
+    .edit-btn {
+        display: none;
+        font-size: var(--font-size-normal);
+        margin-left: 10px;
+        margin-bottom: 5px;
+    }
+
+    .ivu-icon{
+        cursor:pointer;
+        color:white;
+    }
+}
+.time-zone-label{
+    width:300px;
+}
+.time-zone-label:hover + .edit-time-btn{
+    display:inline-block;
+}
+.campus-modal {
+    text-align: center;
+    color: #DDDDDD;
+    .campus-name-item {
+        margin-top: 10px;
+        position: relative;
+
+        &:hover .campus-btn-edit {
+            display: inline-block;
+        }
+
+        &:hover {
+            color: white;
+            font-weight: 500;
+        }
+
+        .campus-name {
+            font-size: 16px;
+            cursor: pointer;
+        }
+
+        .campus-btn-edit {
+            margin-left: 15px;
+            display: none;
+            cursor: pointer;
+            position: absolute;
+            right: 15px;
+        }
+    }
+}
+.semester-name-label {
+    display: inline-block;
+    vertical-align: super;
+}
+.period-wrap {
+    height: 100%;
+    padding-left: 15px;
+}
+
+.period-wrap {
+
+    .period-list {
+        width: 100%;
+        overflow: auto;
+
+        &::-webkit-scrollbar { /*滚动条整体样式*/
+            width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
+            height: 1px;
+        }
+
+        &::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+            background: rgb(124,124,124);
+        }
+
+        &::-webkit-scrollbar-track { /*滚动条里面轨道*/
+            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
+            background: rgba(68,68,68,.5);
+        }
+
+        .campus-label {
+            color: aqua;
+            border: 1px solid aqua;
+            width: fit-content;
+            padding: 0px 5px;
+            border-radius: 4px;
+            font-size: 10px;
+            float: right;
+            margin-right:5px;
+            margin-top: 5px;
+        }
+    }
+
+    .period-item {
+        position: relative;
+        padding: 10px 10px 10px 0px;
+        border-bottom: 1px solid var(--border-color);
+        cursor: pointer;
+
+        &-name {
+            font-size: @large-fontSize;
+            color: var(--primary-text-color);
+            font-weight: bold;
+            margin: 2px 0px;
+            width:100%;
+            .period-btn-edit {
+                font-size: var(--font-size-normal);
+                margin-left: 10px;
+                margin-bottom: 5px;
+                display: none;
+            }
+        }
+
+        &-num {
+            padding-left: 5px;
+            color: var(--label-text-color);
+            font-size: var(--font-size-normal);
+
+            span {
+                display: inline-block;
+                width: 3px;
+                height: 10px;
+                margin-right: 5px;
+                background: var(--label-text-color);
+            }
+        }
+    }
+}
+
+.split-right{
+    padding: 0px 15px;
+    height: 100%;
+    .setting-block {
+        margin-top: 20px;
+    }
+    .block-title {
+        color: white;
+        border-left: 2px solid #1cc0f3;
+        line-height: 12px;
+        padding-left: 4px;
+        user-select: none;
+    }
+    .setting-content {
+        background: #404042;
+        padding: 15px 10px;
+        border-radius: 5px;
+        margin-right: 12px;
+        margin-top: 6px;
+        box-shadow: 0 26px 40px -24px rgb(30, 31, 33);
+    }
+}

+ 893 - 0
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/NewSystemSetting.vue

@@ -0,0 +1,893 @@
+<template>
+    <div class="sm-system dark-iview-input" @click="initStatus">
+        <Loading v-if="isLoading"></Loading>
+        <div class="sm-school-name dark-iview-select common-save-btn">
+            <span class="setting-title">{{$t('schoolBaseInfo.schoolNameLabel')}}</span>
+            <div class="editable school-name dark-iview-input disabled-iview-select text-cursor-disabled" @click.stop>
+                <Input v-model="schoolSetting.name" :disabled="!editSchNmStatus" :placeholder="$t('schoolBaseInfo.pdHolder')" :style="{width: snWitdh+'px'}" />
+                <Icon type="md-create" class="edit-btn" :title="$t('schoolBaseInfo.editLabel')" @click.stop="editSchNmStatus = !editSchNmStatus" />
+            </div>
+            <div class="editable time-zone-select" style="margin-left:100px;" @click.stop>
+                <span class="setting-title">{{$t('schoolBaseInfo.tmzLabel')}}</span>
+                <Select filterable v-model="schoolSetting.timeZone.label" label-in-value :style="{width: tzWidth+'px', verticalAlign:'baseline'}" :placeholder="$t('schoolBaseInfo.tmzHolder')">
+                    <Option v-for="(item,index) in timeZoneList" :value="item.label" :key="index" @click.native="setTimeZone(item)">{{ item.label }}</Option>
+                </Select>
+            </div>
+            <Button v-if="$access.ability('admin','schoolSetting-upd').validateAll" class="school-tools" :loading="isLoading" :disabled="!updated" icon="ios-albums-outline" @click="saveData()">{{$t('schoolBaseInfo.saveInfo')}}</Button>
+        </div>
+        <div class="sm-system-body dark-iview-split disabled-iview-select text-cursor-disabled">
+            <Split v-model="split1">
+                <!--学段列表-->
+                <div slot="left" class="period-wrap">
+                    <div class="col-title">
+                        <span>{{$t('schoolBaseInfo.periodSettingLabel')}}</span>
+                        <Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-add" @click="addPeriod()" class="action-btn-icon" />
+                        <Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-trash" @click="showComfirmDelPeriod()" :title="$t('schoolBaseInfo.delete')" :class="editIconStatus ? 'action-btn-icon':'custom-label-disabeld action-btn-icon'" />
+                        <Icon v-if="$access.ability('admin','schoolSetting-upd').validateAll" type="md-create" @click.stop="editPrdIndex = curPriodIndex" :title="$t('schoolBaseInfo.editLabel')" :class="editIconStatus ? 'action-btn-icon':'custom-label-disabeld action-btn-icon'" />
+                    </div>
+                    <Draggable ghost-class="ghost" class="period-list list-group" :list="schoolSetting.period" :animation='200'>
+                        <div class="period-item list-group-item" v-for="(item,index) in schoolSetting.period" :key="index" @click.capture="choosePeriod(index)" :class="index == curPriodIndex ? 'block-bg-active block-bg':'block-bg'">
+                            <p class="period-item-name semester-name-label dark-iview-input" @click.stop>
+                                <Input v-model="item.name" :disabled="editPrdIndex !== index" :placeholder="$t('schoolBaseInfo.pdHolder')" style="width: 180px" />
+                                <span class="campus-label" @click="setCampus">
+                                    {{item.campusId === null ? $t('schoolBaseInfo.campusHolder'): $JSONPath.query(schoolSetting, "$..campuses[?(@.id=='" + item.campusId + "')]").length > 0 ? $JSONPath.query(schoolSetting, "$..campuses[?(@.id=='" + item.campusId + "')]")[0].name : $t('schoolBaseInfo.campusHolder') }}
+                                </span>
+                            </p>
+                            <p class="period-item-num"><span></span>{{ $t('schoolBaseInfo.semesterNum') + item.semesters.length}}</p>
+                            <p class="period-item-num"><span></span>{{ $t('schoolBaseInfo.gradeNum') + item.grades.length}}</p>
+                            <p class="period-item-num"><span></span>{{ $t('schoolBaseInfo.periodNum') + item.subjects.length}}</p>
+                        </div>
+                    </Draggable>
+                </div>
+                <div slot="right" class="split-right">
+                    <vuescroll>
+                        <!-- 学期设置 -->
+                        <div class="setting-block">
+                            <p class="block-title">学期</p>
+                            <div class="setting-content step-content">
+
+                            </div>
+                        </div>
+                        <!-- 时段设置 -->
+                        <div class="setting-block">
+                            <p class="block-title">时段</p>
+                            <div class="setting-content step-content">
+                            </div>
+                        </div>
+                        <!-- 学科设置 -->
+                        <div class="setting-block">
+                            <p class="block-title">学科</p>
+                            <div class="setting-content step-content">
+                            </div>
+                        </div>
+                        <!-- 学科设置 -->
+                        <div class="setting-block">
+                            <p class="block-title">年级</p>
+                            <div class="setting-content step-content">
+                            </div>
+                        </div>
+                        <!-- 学科设置 -->
+                        <div class="setting-block">
+                            <p class="block-title">学情设置</p>
+                            <div class="setting-content step-content">
+                            </div>
+                        </div>
+                    </vuescroll>
+                </div>
+            </Split>
+        </div>
+        <Modal v-model="campusStatus" class="campus-modal dark-iview-modal" @on-cancel="selectedCampusIndex = -1" @on-ok="confirmCampus" @click.native="initStatus">
+            <p slot="header" style="color:#DDDDDD;letter-spacing:2px;font-weight:400;">{{$t('schoolBaseInfo.setCampus')}}</p>
+            <p v-for="(item,index) in schoolSetting.campuses" class="campus-name-item dark-iview-input disabled-iview-select text-cursor-disabled" :key="index" @click.stop="selectedCampusIndex = index">
+                <Icon type="md-checkmark" size="20" style="margin-right:10px;position:absolute;left:15px;" v-if="index == selectedCampusIndex" />
+                <Input v-model="item.name" :disabled="editCamIndex !== index" :placeholder="$t('schoolBaseInfo.campusHolder')" :style="{width: getWidth(0, item.name)+'px'}" />
+                <Icon type="md-create" class="campus-btn-edit" :title="$t('schoolBaseInfo.editLabel')" size="20" @click.stop="editCamIndex = index" />
+                <Icon type="md-trash" class="campus-btn-edit" :title="$t('schoolBaseInfo.delete')" size="20" style="margin-right:40px;" @click.stop="delCampus(index)" />
+            </p>
+            <Icon type="md-add-circle" size="40" style="margin:auto;cursor:pointer;margin-top:30px;" @click="addCampus" />
+        </Modal>
+    </div>
+</template>
+
+<script>
+import Draggable from 'vuedraggable'
+import '@/utils/Math.uuid'
+export default {
+    components: {
+        Draggable
+    },
+    data() {
+        return {
+            addTypeStatus: false,
+            typeItem: {
+                base: '',
+                name: '',
+                id: ''
+            },
+            delSubStatus: false,
+            delAnaStatus: false,
+            delGraStatus: false,
+
+            editCamIndex: -1,
+            editSchNmStatus: false,
+            editPrdIndex: -1,
+            editTZStatsu: true,
+            editGraStatus: false,
+            editSubStatus: false,
+            editAnaStatus: false,
+            editSemIndex: -1,
+            split1: 0.2,
+            split2: 0.38,
+            split3: 0.38,
+            monthList: [],
+            timeZoneList: [],
+            isLoading: false,
+            dataDefault: {},
+            updated: false,
+            curPriodIndex: 0,
+            curSemIndex: 0,
+            isInit: true,
+            schoolSetting: {
+                schoolCode: '',
+                name: '',
+                period: [],
+                campuses: [],
+                timeZone: {
+                    "label": "",
+                    "value": ""
+                }
+            },
+
+            colorList: [],
+            TERM_MAX_LENGTH: 6, // 学期数上限
+            campusStatus: false,
+            semDays: [],
+            selectedCampusIndex: -1
+        }
+    },
+    methods: {
+        /**
+         * 初始化状态
+         */
+        initStatus() {
+            let isRep = false
+            let pdName = this.schoolSetting.period.map(item => {
+                return item.name
+            })
+            console.log(pdName)
+            // 检查学段名称
+            pdName.forEach((item, index) => {
+                if (pdName.indexOf(item) != index) {
+                    isRep = true
+                    this.$Message.warning(this.$t('schoolBaseInfo.pdWarning'))
+                }
+            })
+            if (isRep) return
+            let curPd = this.schoolSetting.period[this.curPriodIndex]
+
+            // 检查学期名称
+            let semName = curPd.semesters.map(item => {
+                return item.name
+            })
+            semName.forEach((item, index) => {
+                if (semName.indexOf(item) != index) {
+                    isRep = true
+                    this.$Message.warning(this.$t('schoolBaseInfo.semWarning'))
+                }
+            })
+            if (isRep) return
+
+            // 检查年级名称
+            let gradeName = curPd.grades.map(item => {
+                return item.name
+            })
+            gradeName.forEach((item, index) => {
+                if (gradeName.indexOf(item) != index) {
+                    isRep = true
+                    this.$Message.warning(this.$t('schoolBaseInfo.gdNameWarning'))
+                }
+            })
+            if (isRep) return
+
+            // 检查学科名称
+            let subName = curPd.subjects.map(item => {
+                return item.name
+            })
+            subName.forEach((item, index) => {
+                if (subName.indexOf(item) != index) {
+                    isRep = true
+                    this.$Message.warning(this.$t('schoolBaseInfo.subWarning'))
+                }
+            })
+            if (isRep) return
+
+            // 检查考试名称
+            let exName = curPd.analysis.type.map(item => {
+                return item.name
+            })
+            exName.forEach((item, index) => {
+                if (exName.indexOf(item) != index) {
+                    isRep = true
+                    this.$Message.warning(this.$t('schoolBaseInfo.exWarning'))
+                }
+            })
+            if (isRep) return
+
+            this.delGraStatus = false
+            this.delSubStatus = false
+            this.delAnaStatus = false
+            this.editSubStatus = false
+            this.editGraStatus = false
+            this.editAnaStatus = false
+            this.editPrdIndex = -1
+            this.editSemIndex = -1
+            this.editCamIndex = -1
+            this.editTZStatsu = true
+            this.editSchNmStatus = false
+        },
+        //初始化数据
+        initData() {
+            this.schoolSetting.schoolCode = this.$store.state.userInfo.schoolCode
+            this.schoolSetting.id = this.$store.state.userInfo.schoolCode
+            this.schoolSetting.code = this.$store.state.userInfo.schoolCode
+            this.schoolSetting.name = this.$store.state.userInfo.school
+
+            this.schoolSetting.period.push({
+                name: this.$t('schoolBaseInfo.presetPeriod') + '1',
+                id: this.guid(),
+                gradeCount: 0,
+                semesterCount: 0,
+                subjectCount: 0,
+                semesters: [],
+                grades: [],
+                subjects: [],
+                campusId: ""
+            })
+            this.schoolSetting.period[0].semesters.push({
+                name: this.$t('schoolBaseInfo.persetSemester'),
+                id: this.guid(),
+                month: 1,
+                day: 1
+            })
+            this.schoolSetting.period[0].grades.push({
+                name: this.$t('schoolBaseInfo.presetGrade1'),
+                id: this.guid()
+            })
+            this.schoolSetting.period[0].grades.push({
+                name: this.$t('schoolBaseInfo.presetGrade2'),
+                id: this.guid()
+            })
+            this.schoolSetting.period[0].grades.push({
+                name: this.$t('schoolBaseInfo.presetGrade3'),
+                id: this.guid()
+            })
+            this.schoolSetting.period[0].subjects.push({
+                name: this.$t('schoolBaseInfo.presetSubject1'),
+                id: this.guid()
+            })
+            this.schoolSetting.period[0].subjects.push({
+                name: this.$t('schoolBaseInfo.presetSubject2'),
+                id: this.guid()
+            })
+            this.schoolSetting.period[0].subjects.push({
+                name: this.$t('schoolBaseInfo.presetSubject3'),
+                id: this.guid()
+            })
+            this.schoolSetting.period[0].analysis = {
+                income: 10,
+                touch: 10,
+                type: this.$GLOBAL.EXAM_TYPE()
+            }
+            this.updated = false
+            this.countSemDays()
+        },
+        //计算时间轴选中颜色
+        timeLineColor(index) {
+            let len = this.schoolSetting.period[this.curPriodIndex].semesters.length
+            let curIndex = -1
+            if (this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month <= (index + 1)) {
+                if (this.curSemIndex < len - 1) {
+                    if (this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex + 1].month > (index + 1)) {
+                        curIndex = this.curSemIndex
+                    }
+                }
+            }
+            let curMonth = this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month
+            let nextMonth = -1
+            if (this.curSemIndex == len - 1) {
+                nextMonth = this.schoolSetting.period[this.curPriodIndex].semesters[0].month
+            } else {
+                nextMonth = this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex + 1].month
+            }
+            if (curIndex != -1) {
+                return {
+                    color: this.colorList[curIndex],
+                    text: this.schoolSetting.period[this.curPriodIndex].semesters[curIndex].name,
+                    showArrow: (index + 1) == curMonth || (index + 2) == nextMonth
+                }
+            } else if (this.curSemIndex == len - 1) {
+                if (this.schoolSetting.period[this.curPriodIndex].semesters[0].month > (index + 1) || this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month <= (index + 1)) {
+                    curIndex = this.curSemIndex
+                    return {
+                        color: this.colorList[curIndex],
+                        text: this.schoolSetting.period[this.curPriodIndex].semesters[curIndex].name,
+                        showArrow: (index + 1) == curMonth || (index + 2) == nextMonth
+                    }
+                } else {
+                    return {
+                        color: '#606060',
+                        text: '',
+                        showArrow: (index + 1) == curMonth || (index + 2) == nextMonth
+                    }
+                }
+            } else {
+                return {
+                    color: '#606060',
+                    text: '',
+                    showArrow: (index + 1) == curMonth || (index + 2) == nextMonth
+                }
+            }
+
+        },
+        //获取月份列表
+        getMonthList() {
+            let lang = window.localStorage.getItem('local')
+            if (lang.indexOf('CN') != -1 || lang.indexOf('cn') != -1) {
+                this.monthList = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
+            } else if (lang.indexOf('TW') != -1 || lang.indexOf('tw') != -1) {
+                this.monthList = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
+            } else {
+                this.monthList = ['JAN.', 'FEB.', 'MAR.', 'APR.', 'MAY.', 'JUN.', 'JUL.', 'AUG.', 'SEP.', 'OCT.', 'NOV.', 'DEC.']
+            }
+        },
+        //设置学校时区
+        setTimeZone(item) {
+            this.schoolSetting.timeZone.value = item.value
+            this.editTZStatsu = true
+        },
+
+        //删除考试类型
+        confirmDelAna(index) {
+            this.$Modal.confirm({
+                title: this.$t('schoolBaseInfo.delExamTitle'),
+                content: this.$t('schoolBaseInfo.delete') + this.schoolSetting.period[this.curPriodIndex].analysis.type[index].name + this.$t('schoolBaseInfo.delContent'),
+                onOk: () => {
+                    this.schoolSetting.period[this.curPriodIndex].analysis.type.splice(index, 1)
+                }
+            })
+        },
+        //显示删除年级
+        showDelGrade(index) {
+            this.$Modal.confirm({
+                title: this.$t('schoolBaseInfo.delGradeTitle'),
+                content: this.$t('schoolBaseInfo.delete') + this.schoolSetting.period[this.curPriodIndex].grades[index].name + this.$t('schoolBaseInfo.delContent'),
+                onOk: () => {
+                    this.schoolSetting.period[this.curPriodIndex].grades.splice(index, 1)
+                }
+            })
+        },
+        //删除学科
+        delSubject(index) {
+            this.$Modal.confirm({
+                title: this.$t('schoolBaseInfo.delSubjectTitle'),
+                content: this.$t('schoolBaseInfo.delete') + this.schoolSetting.period[this.curPriodIndex].subjects[index].name + this.$t('schoolBaseInfo.delContent'),
+                onOk: () => {
+                    this.schoolSetting.period[this.curPriodIndex].subjects.splice(index, 1)
+                }
+            })
+        },
+        /**确认删除学段提示框 */
+        showComfirmDelPeriod() {
+            this.$Modal.confirm({
+                title: this.$t('schoolBaseInfo.delPdTitle'),
+                content: this.$t('schoolBaseInfo.delete') + this.schoolSetting.period[this.curPriodIndex].name + this.$t('schoolBaseInfo.delContent'),
+                onOk: () => {
+                    let index = this.curPriodIndex
+                    this.curSemIndex = 0
+                    this.curPriodIndex = 0
+                    if (this.schoolSetting.period.length > 1) {
+                        this.schoolSetting.period.splice(index, 1)
+                    } else {
+                        this.$Message.warning(this.$t('schoolBaseInfo.ssTips2'))
+                    }
+                }
+            })
+        },
+        //删除校区
+        delCampus(index) {
+            this.$Modal.confirm({
+                title: this.$t('schoolBaseInfo.delCampusTitle'),
+                content: this.$t('schoolBaseInfo.delete') + this.schoolSetting.campuses[index].name + this.$t('schoolBaseInfo.delContent'),
+                onOk: () => {
+                    this.schoolSetting.campuses.splice(index, 1)
+                }
+            })
+        },
+        /**确认删除学期提示框 */
+        showComfirmDelSemester() {
+            this.$Modal.confirm({
+                title: this.$t('schoolBaseInfo.delSmTitle'),
+                content: this.$t('schoolBaseInfo.delete') + this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].name + this.$t('schoolBaseInfo.delContent'),
+                onOk: () => {
+                    let semIndex = this.curSemIndex
+                    let prdIndex = this.curPriodIndex
+                    if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 1) {
+                        //this.curPriodIndex = 0
+                        this.curSemIndex = 0
+                        this.schoolSetting.period[prdIndex].semesters.splice(semIndex, 1)
+                        this.countSemDays()
+                    } else {
+                        this.$Message.warning(this.$t('schoolBaseInfo.ssTips2'))
+                    }
+                }
+            })
+        },
+        /**
+         * 动态设置input宽度
+         * */
+        getWidth(index, text) {
+            let width = 100
+            if (text) {
+                width = 18.25
+                for (var i = 0; i < text.length; i++) {
+                    var c = text.charCodeAt(i);
+                    //单字节宽度
+                    if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
+                        width += 9
+                    }
+                    else {
+                        //汉字宽度
+                        width += 15.97
+                    }
+                }
+            }
+            return width
+        },
+
+        /**
+         * 计算学期天数
+         * @param date1
+         * @param date2
+        */
+        countSemDays() {
+            this.semDays = []
+            if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 0) {
+                let count = 365
+                let index = 0
+                let year = new Date().getFullYear()
+                for (let i = 0; i < this.schoolSetting.period[this.curPriodIndex].semesters.length; i++) {
+                    if (i == (this.schoolSetting.period[this.curPriodIndex].semesters.length - 1)) {
+                        index = i
+                        break
+                    } else {
+                        let sDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].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)
+                        count -= d
+                        //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[i], 'days', d ? d : 365)
+                        this.semDays.push(d ? d : 365)
+                    }
+                }
+                //this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count ? count : 365)
+                this.semDays.push(count ? count : 365)
+            }
+        },
+        /**
+         * 计算两个日期的天数
+         * @param date1
+         * @param date2
+         */
+        getDays(date1, date2) {
+            var date1Str = date1.split("-");//将日期字符串分隔为数组,数组元素分别为年.月.日
+            //根据年 . 月 . 日的值创建Date对象
+            var date1Obj = new Date(date1Str[0], (date1Str[1] - 1), date1Str[2]);
+            var date2Str = date2.split("-");
+            var date2Obj = new Date(date2Str[0], (date2Str[1] - 1), date2Str[2]);
+            var t1 = date1Obj.getTime();
+            var t2 = date2Obj.getTime();
+            var dateTime = 1000 * 60 * 60 * 24; //每一天的毫秒数
+            var minusDays = Math.floor(((t2 - t1) / dateTime));//计算出两个日期的天数差
+            var days = Math.abs(minusDays);//取绝对值
+            return days;
+        },
+        confirmCampus() {
+            if (this.selectedCampusIndex !== -1) {
+                this.$set(this.schoolSetting.period[this.curPriodIndex], 'campusId', this.schoolSetting.campuses[this.selectedCampusIndex].id)
+                //this.schoolSetting.period[this.curPriodIndex].campusId = this.schoolSetting.campuses[this.selectedCampusIndex].id
+                this.selectedCampusIndex = -1
+            }
+        },
+        //添加校区
+        addCampus() {
+            //不限制校区数量的设置
+            // if (this.schoolSetting.campuses.length >= 2) {
+            //     this.$Message.error({
+            //         background: true,
+            //         content: this.$t('schoolBaseInfo.campusWarning')
+            //     })
+            // } else {
+            this.schoolSetting.campuses.push({
+                name: this.$t('schoolBaseInfo.setCampus'),
+                id: Math.uuid()
+            })
+            this.$nextTick(() => {
+                setTimeout(() => {
+                    this.editCamIndex = this.schoolSetting.campuses.length - 1
+                }, 200)
+            })
+            // }
+        },
+        setCampus() {
+            this.editPrdIndex = -1
+            if (this.$access.ability('admin', 'schoolSetting-upd').validateAll) {
+                this.campusStatus = true
+            } else {
+                this.$Message.warning(this.$t('schoolBaseInfo.authWarning'))
+            }
+        },
+
+        //选择学期
+        chooseSemester(index) {
+            if (index != this.curSemIndex) {
+                this.editSemIndex = -1
+                this.curSemIndex = index
+            }
+        },
+        //选择学段
+        choosePeriod(index) {
+            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) {
+                    this.selectedCampusIndex = item
+                    break
+                }
+            }
+            //计算天数
+            if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 0) {
+                this.semDays = []
+                if (!this.schoolSetting.period[this.curPriodIndex].semesters[0].days) {
+                    let count = 365
+                    let index = 0
+                    let year = new Date().getFullYear()
+                    for (let i = 0; i < this.schoolSetting.period[this.curPriodIndex].semesters.length; i++) {
+                        if (i == (this.schoolSetting.period[this.curPriodIndex].semesters.length - 1)) {
+                            index = i
+                            break
+                        } else {
+                            let sDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].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)
+                            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)
+                }
+            }
+
+        },
+        //保存数据
+        saveData() {
+            this.handleData()
+            this.isLoading = true
+            this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolSetting).then(
+                (res) => {
+                    if (!res.error) {
+                        this.$Message.success(this.$t('schoolBaseInfo.ssTips3'))
+                        this.updated = false
+
+                        let schoolStr = localStorage.getItem('school_profile')
+                        if (schoolStr) {
+                            schoolStr = decodeURIComponent(schoolStr, "utf-8")
+                            let schoolJson = JSON.parse(schoolStr)
+                            schoolJson.school_base = this.schoolSetting
+                            this.$store.dispatch('user/setSchoolProfile', schoolJson)
+                        } else {
+                            this.$store.dispatch('user/getSchoolProfile')
+                        }
+
+                    }
+                },
+                (err) => {
+                    console.log(err)
+                    this.$Message.error(this.$t('schoolBaseInfo.saveErr'))
+                }
+            ).finally(() => {
+                setTimeout(() => {
+                    this.isLoading = false
+                }, 400)
+            })
+        },
+        getSchoolBaseData() {
+            this.isLoading = true
+            this.$store.dispatch('user/getSchoolProfile').then(
+                (res) => {
+                    if (res) {
+                        this.isInit = true
+                        this.schoolSetting = JSON.parse(JSON.stringify(res.school_base))
+                        //计算学期天数
+                        if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 0) {
+                            this.semDays = []
+                            if (!this.schoolSetting.period[this.curPriodIndex].semesters[0].days) {
+                                let count = 365
+                                let index = 0
+                                let year = new Date().getFullYear()
+                                for (let i = 0; i < this.schoolSetting.period[this.curPriodIndex].semesters.length; i++) {
+                                    if (i == (this.schoolSetting.period[this.curPriodIndex].semesters.length - 1)) {
+                                        index = i
+                                        break
+                                    } else {
+                                        let sDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].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)
+                                        count -= d
+                                        this.semDays.push(d)
+                                    }
+                                }
+                                this.semDays.push(count)
+                            }
+                        }
+                    } else {
+                        this.getLocalDefaultData()
+                        this.isInit = true
+                        this.schoolSetting.period[0].grades = JSON.parse(JSON.stringify(this.dataDefault.grades))
+                        this.schoolSetting.period[0].subjects = JSON.parse(JSON.stringify(this.dataDefault.subjects))
+                    }
+                },
+                (err) => {
+                    console.log(err)
+                    this.getLocalDefaultData()
+                    this.isInit = true
+                    this.schoolSetting.period[0].grades = JSON.parse(JSON.stringify(this.dataDefault.grades))
+                    this.schoolSetting.period[0].subjects = JSON.parse(JSON.stringify(this.dataDefault.subjects))
+                }
+            ).finally(() => {
+                setTimeout(() => {
+                    this.isLoading = false
+                }, 500)
+            })
+        },
+        handleData() {
+            for (let i = 0; i < this.schoolSetting.period.length; i++) {
+                this.schoolSetting.period[i].gradeCount = this.schoolSetting.period[i].grades.length
+                this.schoolSetting.period[i].semesterCount = this.schoolSetting.period[i].semesters.length
+                this.schoolSetting.period[i].subjectCount = this.schoolSetting.period[i].subjects.length
+            }
+        },
+        guid() {
+            function S4() {
+                return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
+            }
+            return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
+        },
+        addSubject() {
+            this.schoolSetting.period[this.curPriodIndex].subjects.push({
+                name: this.$t('schoolBaseInfo.presetSubject') + (this.schoolSetting.period[this.curPriodIndex].subjects.length + 1),
+                id: this.guid()
+            })
+            this.editSubStatus = true
+        },
+
+        addGrade() {
+            this.schoolSetting.period[this.curPriodIndex].grades.push({
+                name: this.$t('schoolBaseInfo.persetGrade') + (this.schoolSetting.period[this.curPriodIndex].grades.length),
+                id: this.guid()
+            })
+            this.editGraStatus = true
+        },
+        addPeriod() {
+            //暂未对接授权系统,默认最多设置三个学制/学院
+            if (this.schoolSetting.period.length >= 3) {
+                this.$Message.error({
+                    background: true,
+                    content: this.$t('schoolBaseInfo.campusWarning'),
+                    duration: 2
+                })
+            } else {
+                this.schoolSetting.period.push({
+                    name: this.$t('schoolBaseInfo.presetPeriod') + (this.schoolSetting.period.length + 1),
+                    id: this.guid(),
+                    campusId: '',
+                    gradeCount: 0,
+                    semesterCount: 0,
+                    subjectCount: 0,
+                    semesters: JSON.parse(JSON.stringify(this.dataDefault.semesters)),
+                    grades: JSON.parse(JSON.stringify(this.dataDefault.grades)),
+                    subjects: JSON.parse(JSON.stringify(this.dataDefault.subjects)),
+                    analysis: {
+                        income: 10,
+                        touch: 10,
+                        eugenics: 10,
+                        type: this.$GLOBAL.EXAM_TYPE()
+                    }
+                })
+                this.choosePeriod(this.schoolSetting.period.length - 1)
+                this.$nextTick(() => {
+                    setTimeout(() => {
+                        this.editPrdIndex = this.curPriodIndex
+                    }, 200)
+                })
+            }
+        },
+        addExamType() {
+            if (!this.schoolSetting.period[this.curPriodIndex].analysis.type) {
+                this.schoolSetting.period[this.curPriodIndex].analysis.type = []
+            }
+            this.schoolSetting.period[this.curPriodIndex].analysis.type.push({
+                id: this.guid(),
+                name: this.$t('schoolBaseInfo.examHolder')
+            })
+            this.editAnaStatus = true
+        },
+        // 添加学期
+        addSemester() {
+            let semLen = this.schoolSetting.period[this.curPriodIndex].semesters.length
+            if (semLen < this.TERM_MAX_LENGTH) {
+                let defMonth = semLen == 0 ? 1 : this.schoolSetting.period[this.curPriodIndex].semesters[semLen - 1].month + 1
+                this.schoolSetting.period[this.curPriodIndex].semesters.push({
+                    name: this.$t('schoolBaseInfo.persetSemester') + (this.schoolSetting.period[this.curPriodIndex].semesters.length + 1),
+                    month: defMonth,
+                    day: 26,
+                    id: this.guid()
+                })
+                this.countSemDays()
+                this.$nextTick(() => {
+                    setTimeout(() => {
+                        this.curSemIndex = this.schoolSetting.period[this.curPriodIndex].semesters.length - 1
+                        this.editSemIndex = this.curSemIndex
+                    }, 200)
+                })
+            } else {
+                this.$Message.info(this.$t('schoolBaseInfo.ssTips7'))
+            }
+        },
+        getLocalDefaultData() {
+            let data = require('@/static/baseDataDefault.json')
+            let lang = window.localStorage.getItem('local')
+            let result = data.filter(item => {
+                return item.lang == lang
+            })
+            this.dataDefault = result.length > 0 ? result[0] : data[0]
+        },
+        //根据语言读取时区列表
+        getTimeZoneList() {
+            let lang = window.localStorage.getItem('local')
+            if (lang.indexOf('CN') != -1 || lang.indexOf('cn') != -1) {
+                this.timeZoneList = require('@/static/time-zone/timeCN.json')
+            } else if (lang.indexOf('TW') != -1 || lang.indexOf('tw') != -1) {
+                this.timeZoneList = require('@/static/time-zone/timeTW.json')
+            } else {
+                this.timeZoneList = require('@/static/time-zone/timeEN.json')
+            }
+        }
+    },
+    watch: {
+        schoolSetting: {
+            handler(newValue, oldValue) {
+                if (this.isInit) {
+                    this.isInit = false
+                } else {
+                    this.updated = true
+                }
+            },
+            deep: true
+        }
+    },
+    created() {
+        this.getLocalDefaultData()
+        this.initData()
+        this.getSchoolBaseData()
+        this.getTimeZoneList()
+        this.getMonthList()
+    },
+    beforeRouteLeave(to, from, next) {
+        if (this.updated) {
+            let config = {
+                title: this.$t('schoolBaseInfo.saveWarning'),
+                content: this.$t('schoolBaseInfo.ssTips8'),
+                okText: this.$t('schoolBaseInfo.leaveText'),
+                onOk: () => {
+                    next()
+                },
+                onCancel: () => {
+                    next(false)
+                }
+            }
+            this.$Modal.confirm(config)
+        } else {
+            next()
+        }
+    },
+    mounted() {
+        this.colorList = ['#F16C6A', '#68CDF1', '#7C4DFF', '#00796B', '#D32F2F', '#0288D1', '#D32F2F', '#00796B', '#7C4DFF', '#0288D1']
+    },
+    computed: {
+        //计算时区设置宽度
+        tzWidth() {
+            if (this.schoolSetting.timeZone && this.schoolSetting.timeZone.label) {
+                return this.getWidth(0, this.schoolSetting.timeZone.label)
+            } else {
+                return 150
+            }
+        },
+        snWitdh() {
+            if (this.schoolSetting.name) {
+                return this.getWidth(0, this.schoolSetting.name)
+            } else {
+                return 150
+            }
+        },
+        dayList() {
+            let mon = this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month
+            let arr = []
+            if (mon == 2) {
+                arr = [...new Array(29).keys()]
+            } else if (mon == 4 || mon == 6 || mon == 9 || mon == 11) {
+                arr = [...new Array(30).keys()]
+            } else {
+                arr = [...new Array(31).keys()]
+            }
+            let lang = window.localStorage.getItem('local')
+            if (lang.indexOf('CN') != -1 || lang.indexOf('cn') != -1) {
+                return arr.map((item) => {
+                    return (item + 1) + '日'
+                })
+            } else if (lang.indexOf('TW') != -1 || lang.indexOf('tw') != -1) {
+                return arr.map((item) => {
+                    return (item + 1) + '日'
+                })
+            } else {
+                return arr.map((item) => {
+                    return item + 1
+                })
+            }
+        },
+        editIconStatus() {
+            if (this.schoolSetting.period.length > 0) {
+                return true
+            } else {
+                return false
+            }
+        },
+    }
+}
+</script>
+
+<style lang="less" scoped>
+@import "./NewSystemSetting.less";
+</style>
+<style>
+.time-zone-select .ivu-icon-ios-arrow-down:before {
+    display: none;
+}
+
+.time-zone-select .ivu-select-selection {
+    border-color: transparent;
+}
+
+.time-zone-select:hover .ivu-select-selection {
+    border-color: #606060;
+}
+
+.time-zone-select:hover .ivu-icon-ios-arrow-down:before {
+    display: inline-block;
+}
+.school-name .ivu-input-disabled {
+    color: white !important;
+    margin-top: -4px;
+    font-weight: 800;
+}
+
+.ghost {
+    opacity: 0;
+    background: #c8ebfb;
+}
+.semester-name-label .ivu-input[disabled] {
+    font-size: 16px !important;
+    font-weight: bold;
+    color: white;
+}
+</style>

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/EvaluationList/TotalIndex.vue

@@ -138,7 +138,7 @@
 									{{ item.stuCount }}</span>
 								<span>{{ $t("totalAnalysis.echarts_text13") }}:
 									<!-- 暂无实际参与人数数据 -->
-									{{ item.stuCount }}
+									{{ item.stuCount - item.lostStu.length }}
 								</span>
 								<span>{{ $t("totalAnalysis.lostStu") }}:
 									<!-- 缺考人数数据 -->