Browse Source

合并代码

CrazyIter_Bin 3 years ago
parent
commit
3709db6feb
26 changed files with 400 additions and 255 deletions
  1. 9 3
      TEAMModelFunction/TriggerCorrect.cs
  2. 3 1
      TEAMModelOS.SDK/Models/Cosmos/Teacher/CorrectTask.cs
  3. 4 0
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css
  4. 1 1
      TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue
  5. 39 9
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue
  6. 31 118
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/CourseContent.vue
  7. 193 43
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/CourseList.vue
  8. 3 1
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/HomeView.vue
  9. 23 20
      TEAMModelOS/ClientApp/src/components/vote/BaseVotePie.vue
  10. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/en-US/stuAccount.js
  11. 6 2
      TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js
  12. 1 0
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/stuAccount.js
  13. 6 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js
  14. 1 0
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/utils.js
  15. 1 0
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/stuAccount.js
  16. 6 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/studentWeb.js
  17. 1 0
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/utils.js
  18. 2 2
      TEAMModelOS/ClientApp/src/store/module/config.js
  19. 6 1
      TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.vue
  20. 22 7
      TEAMModelOS/ClientApp/src/view/classrecord/HtexRender.vue
  21. 2 6
      TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue
  22. 3 1
      TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkSetting.vue
  23. 7 6
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  24. 1 10
      TEAMModelOS/ClientApp/src/view/student-account/stuMgt/ImportStudent.less
  25. 25 15
      TEAMModelOS/ClientApp/src/view/student-account/stuMgt/ImportStudent.vue
  26. 2 4
      TEAMModelOS/Controllers/School/CourseController.cs

+ 9 - 3
TEAMModelFunction/TriggerCorrect.cs

@@ -82,8 +82,10 @@ namespace TEAMModelFunction
                                             ttl = -1,
                                             pk = "CorrectTask",
                                             code = "CorrectTask-" + marker.id,
+                                            
+                                            id = Guid.NewGuid().ToString(),
                                             //评测id 或者阅卷配置id
-                                            id = correct.id,
+                                            cid = correct.id,
                                             //科目
                                             subject = sub.id,
                                             //科目名称
@@ -122,8 +124,10 @@ namespace TEAMModelFunction
                                             ttl = -1,
                                             pk = "CorrectTask",
                                             code = "CorrectTask-" + tId,
+                                            
+                                            id = Guid.NewGuid().ToString(),
                                             //评测id 或者阅卷配置id
-                                            id = correct.id,
+                                            cid = correct.id,
                                             //科目
                                             subject = sub.id,
                                             //科目名称
@@ -160,8 +164,10 @@ namespace TEAMModelFunction
                                             ttl = -1,
                                             pk = "CorrectTask",
                                             code = "CorrectTask-" + tId,
+                                            
+                                            id = Guid.NewGuid().ToString(),
                                             //评测id 或者阅卷配置id
-                                            id = correct.id,
+                                            cid = correct.id,
                                             //科目
                                             subject = sub.id,
                                             //科目名称

+ 3 - 1
TEAMModelOS.SDK/Models/Cosmos/Teacher/CorrectTask.cs

@@ -6,7 +6,9 @@ namespace TEAMModelOS.SDK.Models
 {
     public class CorrectTask: CosmosEntity
     {
-        /// <summary>
+
+        public string cid { get;set; }
+            /// <summary>
         /// 评测科目
         /// </summary>
         public string subjectName  { get; set; }

+ 4 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css

@@ -112,6 +112,10 @@
 .vote .vote-chart-card {
   width: 50%;
 }
+.vote .warnText {
+  color: red;
+  margin-left: 10px;
+}
 @media screen and (max-width: 1200px) {
   .vote .vote-chart-card {
     width: 70%;

+ 1 - 1
TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue

@@ -7,7 +7,7 @@
 			<span :class="['canvas-tools-item',curMode === 'move' ? 'tools-active' : '']" @click="doMove()" style="border-radius: 15px 0 0 0;">
 				<Icon custom="iconfont icon-left-arrow" size="20"/>
 				<!-- <span>{{ Object.keys(vm).length ? vm.$t('utils.clear') : $t('utils.clear')  }}</span> -->
-				<span>选择</span>
+				<span>{{ vm.$t('utils.choose') }}</span>
 			</span>
 			<span :class="['canvas-tools-item',curMode === 'paint' ? 'tools-active' : '']" @click="doPaint()">
 				<Poptip trigger="click">

+ 39 - 9
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -10,8 +10,8 @@
         <EventBasicInfo />
         <div>
             <div>
-            <!--超时-->
-                <div v-if="getItemTitle.endTime <= '2020.02.10'">
+                <!--超时-->
+                <div v-if="getItemTitle.endTime < (new Date()).getTime() && !voteRes.records.length">
                     <br />
                     <div class="dec animate__animated animate__bounceInLeft">
                         <svg-icon icon-class="handonHint" class="warm-icon" />
@@ -47,6 +47,11 @@
                         <span v-html="voteInfo.description"></span>
                     </div> -->
                     <div class="vote-option">
+                        <div class="title-rect-group">
+                            <span v-show="voteInfo.voteNum > 1 && !voteInfo.repeat"
+                                >{{$t("studentWeb.vote.haveNum")}}:{{ voteNum }}</span
+                            >
+                        </div>
                         <!-- 1票
                         <RadioGroup v-model="voteChecked" v-if="voteInfo.voteNum == 1" class="option-group">
                             <Radio :label="item.code" v-for="(item, index) in voteInfo.options" :key="index" class="option-wrapper">
@@ -89,13 +94,25 @@
                             </label>
                         </div>
                     </div>
-                    <Button :disabled="!isVote" size="large" type="success" @click="submitMessage()">
+                    <Button :disabled="!isVote" 
+                        size="large" type="success" @click="submitMessage()"
+                    >
                         <svg-icon icon-class="vote" class="uploadBtn-icon" />
                         <span style="margin-left:5px">{{ $t("studentWeb.vote.submitBVote") }}</span>
                     </Button>
+                    <span
+                        class="warnText"
+                        v-show="
+                            voteInfo.voteNum < voteChecked.length &&
+                            voteInfo.voteNum > 1
+                        "
+                        >{{ $t("studentWeb.vote.excessNum")}}</span
+                    >
                     <span class="clickbutnoChoosehint"
                         v-if="clickbutnoChoose == true && voteChecked == ''">{{ $t("studentWeb.vote.note") }}</span>
-                    <span v-if="isOverCount" style="margin-top:5px;margin-left:15px;color:red">{{$t("studentWeb.vote.warning2")}}</span>
+                    <span v-show="isOverCount"
+                        style="margin-top: 5px; margin-left: 15px; color: red"
+                    >{{$t("studentWeb.vote.warning2")}}</span>
 
                 </div>
             </div>
@@ -152,9 +169,9 @@
                 voteInfo: {}, //投票信息
                 voteRes: {},
                 voteResData: [],
-                isVote: false,
+                isVote: false, //不可以投票
                 voteStatus:false,
-                voteNum: 0,
+                voteNum: 0, //剩余投票数
                 showResult: false, //显示投票结果
                 chooseVoteRes: {},
                 isLoad: false,
@@ -213,6 +230,7 @@
                                     item.count = 0
                                 }
                                 this.voteInfo = res.vote
+                                this.voteNum = this.voteInfo.voteNum
                                 if (res.vote.progress == "finish") {
                                     this.getVoteRecord()
                                     this.getVoteRes()
@@ -310,8 +328,10 @@
             //获取投票结果
             getVote(data) {
                 if (!this.voteInfo.repeat) {
-                    this.voteChecked.length = 0
-                    this.voteChecked.push(data)
+                    if(this.voteInfo.voteNum <= 1) {
+                        this.voteChecked.length = 0
+                        this.voteChecked.push(data)
+                    }
                 }
             },
             //处理时间结构
@@ -501,7 +521,17 @@
                     }
                 },
                 deep: true
-            }
+            },
+            voteChecked: {
+                handler(n, o) {
+                    if (n.length <= this.voteInfo.voteNum) {
+                        this.voteNum = this.voteInfo.voteNum - n.length
+                        this.isVote = true
+                    } else {
+                        this.isVote = false
+                    }
+                },
+            },
         },
     };
 </script>

+ 31 - 118
TEAMModelOS/ClientApp/src/components/student-web/HomeView/CourseContent.vue

@@ -7,13 +7,13 @@
             <h2>{{ courseNow.course.name }}</h2>
             <!-- <h3 class="course-subject">國中/二年級/{{courseNow.courseSubject}}</h3> -->
             <div @click="changeGroupView()"
-                :class="{ 'group-on': isChangeGroupView == true }"
+                :class="{ 'group-on': isChangeGroupView }"
                 v-if="name == 'tab3'"
             >
                 <svg-icon icon-class="group" class="group-btn" />
             </div>
 
-            <Tabs :value="name" v-model="name">
+            <Tabs v-model="name">
                 <!-- 基本资讯 -->
                 <TabPane :label="$t('studentWeb.courseContent.baseInfo')" name="tab1">
                     <Row :gutter="30">
@@ -97,7 +97,7 @@
                 </TabPane>
                 <!-- 同学名单 -->
                 <TabPane :label="$t('studentWeb.courseContent.classmates')" name="tab3">
-                    <div v-if="isChangeGroupView == false">
+                    <div v-show="!isChangeGroupView">
                         <div>
                             <table>
                                 <tr>
@@ -113,71 +113,20 @@
                                     <td>{{ item.no }}</td>
                                     <td>{{ item.name }}</td>
                                     <td v-if="item.groupName">{{ item.groupName }}</td>
-                                    <td v-else>暂未分组</td>
+                                    <td v-else>{{ $t("studentWeb.courseContent.noTime") }}</td>
                                 </tr>
                             </table>
                         </div>
-                        <!-- <Row :gutter="50">
-                            <i-col :xs="24" :sm="24" :md="12" :lg="12">
-                                <table>
-                                    <tr>
-                                        <th>{{ $t("studentWeb.courseContent.seatNo") }}</th>
-                                        <th>{{ $t("studentWeb.courseContent.name") }}</th>
-                                        <th>{{ $t("studentWeb.courseContent.group") }}</th>
-                                    </tr>
-                                    <tr class="mates-list-item"
-                                        v-for="(item, index) in stuList"
-                                        :key="index"
-                                        v-show="index < 15"
-                                    >
-                                        <td>{{ item.no }}</td>
-                                        <td>{{ item.name }}</td>
-                                        <td v-if="currentLang == 'zh-cn'">第{{ item.group }}组</td>
-                                        <td v-else-if="currentLang == 'zh-tw'">第{{ item.group }}組</td>
-                                        <td v-else-if="currentLang == 'en-us'">{{ item.group }}</td>
-                                    </tr>
-                                </table>
-                            </i-col>
-                            <i-col :xs="24" :sm="24" :md="12" :lg="12">
-                                <table>
-                                    <tr>
-                                        <th>{{ $t("studentWeb.courseContent.seatNo") }}</th>
-                                        <th>{{ $t("studentWeb.courseContent.name") }}</th>
-                                        <th>{{ $t("studentWeb.courseContent.group") }}</th>
-                                    </tr>
-                                    <tr v-for="(item, index) in courseNow.students"
-                                        :key="index"
-                                        v-show="index >= 15 && index < 28"
-                                    >
-                                        <td :class="{ 'my-name': index == 18 }">{{ index + 1 }}</td>
-                                        <td :class="{ 'my-name': index == 18 }">
-                                            {{ item.name }}
-                                            <span v-if="index == 18">{{ currentLang == "en-us" ? "(me)" : "(我)"}}</span>
-                                        </td>
-
-                                        <td :class="{ 'my-name': index == 18 }" v-if="currentLang == 'zh-cn'">
-                                            第{{ item.group }}组
-                                        </td>
-                                        <td :class="{ 'my-name': index == 18 }" v-else-if="currentLang == 'zh-tw'">
-                                            第{{ item.group }}組
-                                        </td>
-                                        <td :class="{ 'my-name': index == 18 }" v-else-if="currentLang == 'en-us'">
-                                            {{ item.group }}
-                                        </td>
-                                    </tr>
-                                </table>
-                            </i-col>
-                        </Row> -->
                     </div>
                     <!--小組模式-->
-                    <div v-if="isChangeGroupView == true">
+                    <div v-show="isChangeGroupView">
                         <Card class="group-student"
                             v-for="(group, gIndex) in stuGroup"
                             :key="gIndex">
                             <h3 class="group-title" v-if="group.name">
                                 {{ group.name }}
                             </h3>
-                            <h3 class="group-title" v-else>暂未分组</h3>
+                            <h3 class="group-title" v-else>{{ $t("studentWeb.courseContent.noTime") }}</h3>
                             <table>
                                 <tr v-for="item in group.info"
                                     :key="item.no"
@@ -192,35 +141,6 @@
                                 </tr>
                             </table>
                         </Card>
-                        <!-- <Card class="group-student"
-                            v-for="groupNo in 5"
-                            :key="groupNo"
-                            :class="{ 'group-studentEn': currentLang == 'en-us' }"
-                        >
-                            <h3 class="group-title" v-if="currentLang == 'zh-cn'">
-                                第{{ groupNo }}组
-                            </h3>
-                            <h3 class="group-title" v-if="currentLang == 'zh-tw'">
-                                第{{ groupNo }}組
-                            </h3>
-                            <h3 class="group-title" v-if="currentLang == 'en-us'">
-                                Group {{ groupNo }}
-                            </h3>
-                            <table>
-                                <tr v-for="(item, index) in courseNow.students"
-                                    :key="index"
-                                    v-show="item.group == groupNo && index < 28"
-                                >
-                                    <td class="student-no" :class="{ 'my-name': index == 18 }">
-                                        {{ index + 1 }}
-                                    </td>
-                                    <td class="student-name" :class="{ 'my-name': index == 18 }">
-                                        {{ item.name }}
-                                        <span v-if="index == 18">{{  currentLang == "en-us" ? "(me)" : "(我)" }}</span>
-                                    </td>
-                                </tr>
-                            </table>
-                        </Card> -->
                     </div>
                 </TabPane>
             </Tabs>
@@ -284,20 +204,6 @@ export default {
             this.$api.studentWeb.getClassroomStudent(req).then(res => {
                 this.stuList = this._.cloneDeep(res.stus[0])
                 this.getGroup(res.stus[0])
-                /* for (let i = 0; i < res.stus[0].length; i++) {
-                    this.stuGroup.push({
-                        id: res.stus[0][i].groupId,
-                        name: res.stus[0][i].groupName,
-                        info: [res.stus[0][i]]
-                    })
-                    for (let j = i + 1; j < res.stus[0].length; j++) {
-                        if(res.stus[0][i].groupId == res.stus[0][j].groupId) {
-                            this.stuGroup[i].info.push(res.stus[0][j])
-                            res.stus[0].splice(j,1)
-                            j--
-                        }
-                    }
-                } */
             })
         },
         // 查找学生(个人)
@@ -311,17 +217,16 @@ export default {
                 scope: course.scope
             }
             this.$api.studentWeb.findListSummary(reqList).then(res => {
-                if(res.stuList.length > 0) {
-                    if(res.stuList[0].students.length > 0) {
+                if(res.stuList.length) {
+                    if(res.stuList[0].students.length) {
                         this.$api.studentWeb.findStuSummary({
                             students: res.stuList[0].students,
                             tmdIds: res.stuList[0].tmids
-                                }).then(res => {
-                                if(res.stus.length > 0) {
-                                    console.log(res.stus);
-                                    this.stuList = this._.cloneDeep(res.stus)
-                                    this.getGroup(res.stus)
-                                }
+                        }).then(res => {
+                            if(res.stus.length) {
+                                this.stuList = this._.cloneDeep(res.stus)
+                                this.getGroup(res.stus)
+                            }
                         })
                     }
                 }
@@ -354,14 +259,20 @@ export default {
     watch: {
         courseNow: {
             handler(n, o) {
-                if(n != undefined) {
+                if(Object.keys(n).length) {
                     this.isNoInfo = false
                     this.showInfo = true
-                    this.week.map(item => {
-                        if(item.name == n.course.timeWeek) {
-                            n.classTime = item.cn + " "+ n.time
-                        }
-                    })
+                    // 处理时间
+                    if(n.course.timeWeek) {
+                        this.week.map(item => {
+                            if(item.name == n.course.timeWeek) {
+                                n.classTime = item.cn + " "+ n.time
+                            }
+                        })
+                    }
+                    else {
+                        n.classTime = n.time
+                    }
                     n.roomName = ""
                     n.teaName = ""
                     // 获取教室名称
@@ -377,13 +288,15 @@ export default {
                         n.roomName = "暂无教室"
                     }
                     // 获取学生名单
-                    if(n.course.classId != "") {
-                        this.findStuInfor(this.courseNow.course)
+                    if(n.course.classId != "" && n.course.classId) {
+                        this.findStuInfor(n.course)
                     } else if(n.course.stuList != "") {
-                        this.findPersonInfo(this.courseNow.course)
+                        this.findPersonInfo(n.course)
                     }
                 }
-                
+                else {
+                    console.log(222222, n);
+                }
             }
         }
     }

+ 193 - 43
TEAMModelOS/ClientApp/src/components/student-web/HomeView/CourseList.vue

@@ -81,10 +81,12 @@
                                         v-show="currentView == 'table'"
                                         :disabled-hover="true"
                                 >
+                                    <!-- 时间 -->
                                     <template slot-scope="{ row }" slot="time">
                                         <p class="list-name">{{ row.time }}</p>
                                         <p>{{ row.label }}</p>
                                     </template>
+                                    <!-- 周一 -->
                                     <template slot-scope="{ row }" slot="Mon">
                                         <div v-for="(item, index) in row.fixList" :key="index">
                                             <div v-if="item.timeWeek == 'MON'"
@@ -97,6 +99,7 @@
                                             </div>
                                         </div>
                                     </template>
+                                    <!-- 周二 -->
                                     <template slot-scope="{ row }" slot="Tue">
                                         <div v-for="(item, index) in row.fixList" :key="index">
                                             <div v-if="item.timeWeek == 'TUE'"
@@ -109,6 +112,7 @@
                                             </div>
                                         </div>
                                     </template>
+                                    <!-- 周三 -->
                                     <template slot-scope="{ row }" slot="Wed">
                                         <div v-for="(item, index) in row.fixList" :key="index">
                                             <div v-if="item.timeWeek == 'WED'"
@@ -121,6 +125,7 @@
                                             </div>
                                         </div>
                                     </template>
+                                    <!-- 周四 -->
                                     <template slot-scope="{ row }" slot="Thu">
                                         <div v-for="(item, index) in row.fixList" :key="index">
                                             <div v-if="item.timeWeek == 'THU'"
@@ -133,6 +138,7 @@
                                             </div>
                                         </div>
                                     </template>
+                                    <!-- 周五 -->
                                     <template slot-scope="{ row }" slot="Fri">
                                         <div v-for="(item, index) in row.fixList" :key="index">
                                             <div v-if="item.timeWeek == 'FRI'"
@@ -197,13 +203,13 @@
                             </ul>
                         </li> -->
                         <!--剛加入的課程-->
-                            <div  v-if="personList.length > 0">
-                                <div v-for="(item, index) in timeTable" :key="index">
+                            <div v-if="personList.length">
+                                <!-- <div v-for="(item, index) in timeTable" :key="index"> -->
                                     <li
                                         class="list-item"
-                                        v-for="(person, num) in item.personList"
-                                        @click="clickCell(item, num, 'list')"
+                                        v-for="(person, num) in personList"
                                         :class="{ 'list-item-selected': unique == person.unique }"
+                                        @click="clickCell(person, num, 'list')"
                                         :key="`j+${num}`"
                                     >
                                         <ul>
@@ -215,7 +221,7 @@
                                             </li>
                                         </ul>
                                     </li>
-                                </div>
+                                <!-- </div> -->
                             </div>
                             <div v-else class="list-item-no">
                                 暂无课程
@@ -286,10 +292,10 @@ export default {
                 }
             ],
             courseList: this.$api.studentWeb.courseList, //moke数据
-            fixList: [],
-            personList: [],
+            fixList: [], //表定课程
+            personList: [], //临时课程
             nowClassInfor: {},
-            timeTable: [],
+            timeTable: [], //页面所有的课程
             unique: '',
         };
     },
@@ -311,9 +317,6 @@ export default {
         })
         this.getClassList()
     },
-    mounted () {
-        // console.log(this.timeTable);
-    },
     methods: {
         getClassList() {
             this.isLoad = true
@@ -333,39 +336,119 @@ export default {
                     // 临时课程
                     var personList = []
                     var list = res.courses
-                    for (let i = 0; i < list.length; i++) {
-                        if(list[i].course) {
-                            for (let j = 0; j < list[i].course.schedule.length; j++) {
-                                // 有classId,表定课程
-                                if(list[i].course.schedule[j].classId == list[i].stuCourse.classId[0]) {
-                                    if(list[i].course.schedule[j].time.length > 0) {
-                                        for (let m = 0; m < list[i].course.schedule[j].time.length; m++) {
-                                            var data = this._.cloneDeep(list[i].course)
-                                            delete data.schedule
-                                            data.school = list[i].stuCourse.school
-                                            data.scope = list[i].stuCourse.scope
-                                            // 拼接得到一个唯一的标识(目前有同一天的同一节数的课程,所以加入j 和m 来区分)
-                                            data.unique = 'class' + list[i].course.no + list[i].course.schedule[j].time[m].week + list[i].course.schedule[j].time[m].id + j + m
-                                            fixList.push(this.getNewClass(data, list[i].course.schedule[j], m))
+                    // 学生
+                    if(this.onlyStu) {
+                        list.forEach(item => {
+                            if(item.course) {
+                                item.course.schedule.forEach((sch, sI) => {
+                                    // 有classId,表定课程
+                                    if(sch.classId == item.stuCourse.classId[0]) {
+                                        if(sch.time.length > 0) {
+                                            for (let m = 0; m < sch.time.length; m++) {
+                                                var data = this._.cloneDeep(item.course)
+                                                delete data.schedule
+                                                data.school = item.stuCourse.school
+                                                data.scope = item.stuCourse.scope
+                                                // 拼接得到一个唯一的标识(目前有同一天的同一节数的课程,所以加入j 和m 来区分)
+                                                data.unique = 'class' + item.course.no + sch.time[m].week + sch.time[m].id + sI + m
+                                                fixList.push(this.getNewClass(data, sch, m))
+                                            }
                                         }
                                     }
-                                }
-                                // 有stulist,临时课程
-                                else if (list[i].course.schedule[j].stulist) {
-                                    if(list[i].course.schedule[j].time.length > 0) {
-                                        for (let m = 0; m < list[i].course.schedule[j].time.length; m++) {
-                                            var data = this._.cloneDeep(list[i].course)
-                                            delete data.schedule
-                                            data.school = list[i].stuCourse.school
-                                            data.scope = list[i].stuCourse.scope
-                                            data.unique = 'person' + list[i].course.no + list[i].course.schedule[j].time[m].week + list[i].course.schedule[j].time[m].id + j + m
-                                            personList.push(this.getNewClass(data, list[i].course.schedule[j], m))
+                                    // 有stulist,临时课程
+                                    else if (sch.stulist) {
+                                        if(sch.time.length) {
+                                            for (let m = 0; m < sch.time.length; m++) {
+                                                var data = this._.cloneDeep(item.course)
+                                                delete data.schedule
+                                                data.school = item.stuCourse.school
+                                                data.scope = item.stuCourse.scope
+                                                data.unique = 'person' + item.course.no + sch.time[m].week + sch.time[m].id + sI + m
+                                                personList.push(this.getNewClass(data, sch, m))
+                                            }
+                                        }
+                                        // 没有时间
+                                        else {
+                                            let datas = this._.cloneDeep(item.course)
+                                            delete datas.schedule
+                                            datas.school = item.stuCourse.school
+                                            datas.scope = item.stuCourse.scope
+                                            datas.unique = 'person' + item.course.no + "008" + "000" + sI + "-1"
+                                            datas.classId = sch.classId
+                                            datas.room = sch.room
+                                            datas.teacherId = sch.teacherId
+                                            datas.notice = sch.notice
+                                            datas.stuList = sch.stulist
+                                            datas.time = "暂未安排时间"
+                                            datas.timeId = 0
+                                            datas.timeWeek = 0
+                                            datas.teaName = ""
+                                            // 获取老师名单
+                                            if(this.teaList.length > 0) {
+                                                this.teaList.map(item => {
+                                                    if(item.id == sch.teacherId) {
+                                                        datas.teaName = item.name
+                                                    }
+                                                })
+                                            }
+                                            personList.push(datas)
                                         }
                                     }
-                                }
+                                })
                             }
-                        }
+                        })
+                    }
+                    // 醍摩豆
+                    else {
+                        list.forEach(item => {
+                            if(item.course) {
+                                // item.stuCourse.stulist.forEach(stu => {
+                                    item.course.schedule.forEach(sch => {
+                                        // if (sch.stulist == stu) {
+                                            if(sch.time.length) {
+                                                for (let m = 0; m < sch.time.length; m++) {
+                                                    var data = this._.cloneDeep(item.course)
+                                                    delete data.schedule
+                                                    data.school = item.stuCourse.school
+                                                    data.scope = item.stuCourse.scope
+                                                    data.unique = 'person' + item.course.no + sch.time[m].week + sch.time[m].id + j + m
+                                                    personList.push(this.getNewClass(data, sch, m))
+                                                }
+                                            }
+                                            // 没有时间
+                                            else {
+                                                let datas = this._.cloneDeep(item.course)
+                                                delete datas.schedule
+                                                datas.school = item.stuCourse.school
+                                                datas.scope = item.stuCourse.scope
+                                                datas.unique = 'person' + item.course.no + "008" + "000" + Math.round(Math.random()*10) + "-1"
+                                                datas.classId = sch.classId
+                                                datas.room = sch.room
+                                                datas.teacherId = sch.teacherId
+                                                datas.notice = sch.notice
+                                                datas.stuList = sch.stulist
+                                                datas.time = "暂未安排时间"
+                                                datas.timeId = 0
+                                                datas.timeWeek = 0
+                                                datas.teaName = ""
+                                                // 获取老师名单
+                                                if(this.teaList.length > 0) {
+                                                    this.teaList.map(item => {
+                                                        if(item.id == sch.teacherId) {
+                                                            datas.teaName = item.name
+                                                        }
+                                                    })
+                                                }
+                                                personList.push(datas)
+                                            }
+                                        // }
+                                    })
+                                    
+                                // })
+                            }
+                        })
                     }
+                    
                     console.log(fixList)
                     console.log(personList)
                     this.fixList = fixList
@@ -399,7 +482,68 @@ export default {
         },
         // 处理上课时间
         getClassTime() {
-            if(this.period != undefined && this.fixList.length) {
+            // 学生登陆
+            if(this.onlyStu) {
+                this.timeTable = (this.period.find(item => {
+                    return item.id == this.$store.state.user.studentProfile.classinfo.periodId
+                })).timetable
+                this.timeTable.forEach(item => {
+                    let newfixlist = []
+                    let notime = [] //没有时间的标准课程
+                    this.fixList.forEach(fix => {
+                        if(fix.timeId == item.id && fix.timeId) {
+                            newfixlist.push(fix)
+                        }
+                        // 没有时间的标准课程
+                        else if (!fix.timeId) {
+                            notime.push(fix)
+                        }
+                    })
+                    item.fixList = newfixlist
+                    item.noTime = notime
+                })
+                // 个人课程
+                this.personList.forEach(per => {
+                    if(per.timeId) {
+                        this.timeTable.forEach(item => {
+                            if(per.timeId == item.id) {
+                                per.time = item.time
+                            }
+                        })
+                    }
+                })
+            }
+            // 醍摩豆登陆
+            else if (this.personList.length) {
+                // 年级id 存在
+                if(this.personList[0].period.id != undefined) {
+                    this.timetable = this.period.find(item => {
+                        return item.id == this.personList[0].period.id
+                    })
+                    this.timeTable.forEach(item => {
+                        let newpersonList = []
+                        this.personList.forEach(per => {
+                            if(per.timeId == item.id && per.timeId) {
+                                newpersonList.push(per)
+                            } else if (!per.timeId) {
+                                newpersonList.push(per)
+                            }
+                        })
+                        item.personList = newpersonList
+                    })
+                }
+                // 年级id 不存在
+                else {
+                    this.timeTable = [{
+                        personList: []
+                    }]
+                    this.personList.forEach(per => {
+                        this.timeTable[0].personList.push(per)
+                    })
+                }
+            }
+            
+            /* if(this.period != undefined && this.fixList.length) {
                 // 选出该年级的上课时间
                 var grades = this._.cloneDeep(this.period)
                 for (let i = 0; i < grades.length; i++) {
@@ -412,20 +556,26 @@ export default {
                 for (let j = 0; j < this.timeTable.length; j++) {
                     var newfixLis = []
                     var newpersonList = []
+                    let noTime = []
                     for (let i = 0; i < this.fixList.length; i++) {
-                        if(this.timeTable[j].id == this.fixList[i].timeId) {
+                        if(this.timeTable[j].id == this.fixList[i].timeId && this.fixList[i].timeId) {
                             newfixLis.push(this.fixList[i])
+                        } else if(!this.fixList[i].timeId) {
+                            noTime.push(this.fixList[i])
                         }
                     }
                     for (let i = 0; i < this.personList.length; i++) {
-                        if(this.timeTable[j].id == this.personList[i].timeId) {
+                        if(this.timeTable[j].id == this.personList[i].timeId && this.personList[i].timeId) {
+                            newpersonList.push(this.personList[i])
+                        } else if(!this.personList[i].timeId) {
                             newpersonList.push(this.personList[i])
                         }
                     }
                     this.timeTable[j].fixList = newfixLis
                     this.timeTable[j].personList = newpersonList
+                    this.timeTable[j].noTime = noTime
                 }
-            }
+            } */
         },
         // 点击单节课,显示基本信息
         /* row:timeTable的某一个
@@ -435,7 +585,7 @@ export default {
         clickCell(row, index, type) {
             this.nowClassInfor = this._.cloneDeep(row)
             if(type) {
-                this.nowClassInfor.course = this._.cloneDeep(row.personList[index])
+                this.nowClassInfor.course = this._.cloneDeep(row)
             } else {
                 this.nowClassInfor.course = this._.cloneDeep(row.fixList[index])
             }

+ 3 - 1
TEAMModelOS/ClientApp/src/components/student-web/HomeView/HomeView.vue

@@ -333,8 +333,10 @@ export default {
                         this.addClassNo = ""
                     } else if(res.status == 2) {
                         this.$Message.warning(this.$t('studentWeb.courseType.warning'))
-                    } else {
+                    } else  if(res.status == -1){
                         this.$Message.error(this.$t('studentWeb.courseType.error'))
+                    } else {
+                        this.$Message.error(this.$t('studentWeb.courseType.api'))
                     }
                 })
             }

+ 23 - 20
TEAMModelOS/ClientApp/src/components/vote/BaseVotePie.vue

@@ -57,7 +57,7 @@
 						selectedOffset: 10,
 						clockwise: true,
 						center: ['50%', '50%'],
-						color: ['#567c94', '#11d8ff', '#FCC708', '#03B48E'], //'#FBFE27','rgb(11,228,96)','#FE5050'
+						color: ['#8b8b8b', '#11d8ff', '#FCC708', '#03B48E'], //'#FBFE27','rgb(11,228,96)','#FE5050'
 						data: [{
 							name: that.$t('vote.noVote'),
 							value: this.noChooseNum
@@ -68,35 +68,38 @@
 
 						label: {
 							normal: {
+								formatter: ['{c|{c}}' + that.$t('unit.text7'), '{b|{b}}'].join('\n'),
 								rich: {
-									b: {
-										color: '#d9efff',
-										fontSize: 15,
-										height: 40
-									},
 									c: {
-										color: '#fff',
-										fontSize: 14,
+										color: 'rgb(246, 246, 246)',
+										fontSize: 12,
 										fontWeight: 'bold',
-										lineHeight: 5
+										lineHeight: 2
+									},
+									b: {
+										color: 'rgb(43, 163, 169)',
+										fontSize: 12,
+										height: 40
 									},
 								},
 							}
 						},
-						itemStyle: {
-							borderWidth: '5',
-						},
 						labelLine: {
 							normal: {
-								backgroundColor: 'yellow',
-								borderColor: 'skyblue',
-								borderWidth: 10,
 								lineStyle: {
-									borderColor: 'skyblue',
-									borderWidth: 10,
-									backgroundColor: 'yellow',
-								}
-							},
+									color: 'rgb(98,137,169)',
+								},
+								smooth: 0.2,
+								length: 10,
+								length2: 20,
+						
+							}
+						},
+						itemStyle: {
+							normal: {
+								shadowColor: 'rgba(0, 0, 0, 0.8)',
+								shadowBlur: 10,
+							}
 						}
 					}]
 				};

+ 2 - 1
TEAMModelOS/ClientApp/src/locale/lang/en-US/stuAccount.js

@@ -97,7 +97,8 @@ export default {
   idFormatWarning:'Error: Student account/ID can only contain numbers',
   gradeWarning:'Warning: Error in grade',
   setNoErr:"Error: Seat number has been repeated within the school",
-  downloadText:'Download List Sample',
+  downloadText:'(Download List Sample)',
+  idRepErr:'帳號已存在,將覆蓋原有帳號',
 
   // Authorization.vue
   authTitle: 'Service Authorization Management',

+ 6 - 2
TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js

@@ -95,7 +95,8 @@ export default {
     courseType: {
         success: "课程加入成功",
         warning: "重复加入课程!",
-        error: "API错误"
+        error: "课程加入失败",
+        api: "API错误",
     },
     coursesCardTitle: 'My Course List',
     newAddCourse: 'The latest addition: Elective Mathematics (2)',
@@ -246,6 +247,8 @@ export default {
         voteTime: 'Poll Duration',
         noData: 'No polling result data yet',
         option: 'Options',
+        haveNum: "可投票数",
+        excessNum: "投票数已超出",
     },
     homework: {
         homeworkUpload: 'Assignment Upload Area',
@@ -476,7 +479,8 @@ export default {
         name: 'Name',
         group: 'Group',
         no1: "Group",
-        no2: ""
+        no2: "",
+        noTime: "暂未分组"
     },
     'calendar-title': 'Calendar-Second semester of 2020 school year',
     today: 'Today',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/stuAccount.js

@@ -98,6 +98,7 @@ export default {
   gradeWarning:'警告:年级错误',
   setNoErr:"错误:座位号已在校內重复",
   downloadText:'(下载名单模板)',
+  idRepErr:'账号已存在,将覆盖原有账号',
 
   // Authorization.vue
   authTitle: '服务授权管理',

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

@@ -95,7 +95,8 @@ export default {
     courseType: {
         success: "课程加入成功",
         warning: "重复加入课程!",
-        error: "API错误"
+        error: "课程加入失败",
+        api: "API错误",
     },
 
     coursesCardTitle: '我的课程清单',
@@ -247,6 +248,8 @@ export default {
         voteTime: '投票时间',
         noData: '暂无投票结果数据',
         option: '选项',
+        haveNum: "可投票数",
+        excessNum: "投票数已超出",
     },
     homework: {
         homeworkUpload: '作业上传区',
@@ -477,7 +480,8 @@ export default {
         name: '姓名',
         group: '组别',
         no1: "第",
-        no2: "组"
+        no2: "组",
+        noTime: "暂未分组"
     },
     'calendar-title': '行事历 - 109学年度第二学期',
     today: '今天',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/utils.js

@@ -4,6 +4,7 @@ export default {
 	audioFormatError:'音频格式不正确!请重新选择!',
 	fileReadFail:'有试题数据读取失败!',
 	uploadLoading:'上传中...',
+	choose:"选择",
 	draw:'绘制',
 	text:'文本输入',
 	clear:'清屏',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/stuAccount.js

@@ -98,6 +98,7 @@ export default {
   gradeWarning:'警告:年級錯誤',
   setNoErr:"錯誤:座位號已在校內重複",
   downloadText:'(下載名單模板)',
+  idRepErr:'帳號已存在,將覆蓋原有帳號',
 
   //Authorization.vue
   authTitle: '服務授權管理',

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

@@ -95,7 +95,8 @@ export default {
     courseType: {
         success: "課程加入成功",
         warning: "重複加入課程!",
-        error: "API錯誤"
+        error: "課程加入失敗",
+        api: "API錯誤",
     },
     coursesCardTitle: '我的課程清單',
     newAddCourse: '最新加入:選修數學(二)',
@@ -246,6 +247,8 @@ export default {
         voteTime: '投票時間',
         noData: '暫無投票結果數據',
         option: '選項',
+        haveNum: "可投票數",
+        excessNum: "投票數已超出",
     },
     homework: {
         homeworkUpload: '作業上傳區',
@@ -476,7 +479,8 @@ export default {
         name: '姓名',
         group: '組別',
         no1: "第",
-        no2: "組"
+        no2: "組",
+        noTime: "暫未分組"
     },
     'calendar-title': '行事歷 - 109學年度第二學期',
     today: '今天',

+ 1 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/utils.js

@@ -4,6 +4,7 @@ export default {
 	audioFormatError: '音訊格式不正確!請重新選擇!',
 	fileReadFail: '有試題資料讀取失敗!',
 	uploadLoading: '上傳中…',
+	choose:"選擇",
 	draw: '畫記',
 	text: '文字輸入',
 	clear: '清除',

+ 2 - 2
TEAMModelOS/ClientApp/src/store/module/config.js

@@ -12,11 +12,11 @@ export default {
             domainUrl: [
                 {
                     station: 'product',
-                    url: 'https://teammodelos.chinacloudsites.cn'
+                    url: 'https://www.teammodel.cn'
                 },
                 {
                     station: 'test',
-                    url: 'https://teammodelos-test.chinacloudsites.cn'
+                    url: 'https://test.teammodel.cn'
                 },
             ]
         },

+ 6 - 1
TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.vue

@@ -40,7 +40,7 @@
                 <div :class="moStatus ? 'class-content mouse-over-status':'class-content'" @mousemove="moStatus = true" @mouseleave="moStatus = false">
                     <div class="courseware-wrap">
                         <!--<DrawHTEX :mapJson="mapJson"></DrawHTEX>-->
-                        <HtexRender></HtexRender>
+                        <HtexRender v-bind:renderJson="renderJsons"></HtexRender>
                         <div class="page-wrap">
                             <Page :total="120" size="small" :current.sync="curPage" show-elevator show-total @on-change="getCurHTEX">
                                 <span>{{curPage}}/12</span>
@@ -615,6 +615,11 @@
                     }],
                     notSupportedMessage: '此视频暂无法播放,请稍后再试' //允许覆盖Video.js无法播放媒体源时显示的默认信息。
                 },
+                //渲染ppt的相关json数据
+                renderJsons: {
+                    "page": 1,
+                    "jsonUrl": require('./data/HtexJson/Complexgraphics.json')
+                }
             }
         },
         methods: {

+ 22 - 7
TEAMModelOS/ClientApp/src/view/classrecord/HtexRender.vue

@@ -16,20 +16,31 @@
   //import res from './data/HtexJson/echart.json'
   //import images from './data/HtexJson/background.png'
   //复杂图形组
-   //import res from './data/HtexJson/Complexgraphics.json'
+  // import res from './data/HtexJson/Complexgraphics.json'
   //公式渲染
-  import res from './data/HtexJson/Math.json'
+//import res from './data/HtexJson/Math.json'
 import { drawRect, drawArc, drawEllipse, drawImage, drawPath, drawLine, drawTable, drawEchart,drawMath } from "../../utils/PublicRenderer.js"
 export default {
   name: 'HtexRender',
+        props: {
+            renderJson: {
+                type: Object,
+                default:null,
+            }
+        },
   data(){
     return{
       stage:'',
-      layersinfo:'' ,
+        layersinfo: '',
+        renderData: {
+            "page": 0,
+            "jsonUrl": {},
+        }
     }
   },
   methods:{
-     initCanvas(page, spacename, initStatus) {
+      initCanvas(jsonUrl, page, spacename, initStatus) {
+      var res = jsonUrl
       var scalingXinfo = 810 / 1280
       var scalingYinfo = 450 / 720
       var pagenow = ''
@@ -183,7 +194,7 @@ export default {
         }
         stage.add(layer);
     },
-    doRender(stage, layer, tr, items, callUrl) {
+      doRender(stage, layer, tr, items, callUrl) {
       let that = this
         let f = function () {
           let promiseArr = []
@@ -271,9 +282,13 @@ export default {
     },
   },
   mounted(){
-    this.initCanvas(1,'container','init')
+      this.renderData = this.renderJson
   },
-  components: {}
+        watch: {
+            renderData: function(val) {
+                this.initCanvas(val.jsonUrl, val.page,'container','init')
+            }
+        },
 }
 </script>
 <style>

+ 2 - 6
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -113,10 +113,6 @@
                     <span :class="curBarIndex == 2 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(2)">
                         {{$t('learnActivity.mgtScEv.markSetting')}}
                     </span>
-                    <!-- 阅卷数据 -->
-                    <!-- <span v-show="isSetting" :class="curBarIndex == 3 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(3)">
-                        {{$t('learnActivity.mgtScEv.markData')}}
-                    </span> -->
 
                     <!--取消一键作答和一键评分功能-->
                     <!--<div style="float:right;" v-if="$access.ability('admin','mock-eva').validateAll" v-show="evaListShow[curEvaIndex] && evaListShow[curEvaIndex].progress == 'going'">
@@ -165,9 +161,9 @@
                     <MarkSetting ref="markSetting" v-if="evaListShow[curEvaIndex]" :evInfo="evaListShow[curEvaIndex]" v-model="isSetting"></MarkSetting>
                 </div>
                 <!-- 阅卷数据 -->
-                <div :class="curBarIndex == 3 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 3">
+                <!-- <div :class="curBarIndex == 3 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 3">
                     <MarkData></MarkData>
-                </div>
+                </div> -->
             </div>
         </Split>
     </div>

+ 3 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkSetting.vue

@@ -165,7 +165,7 @@
             </div>
 
             <!-- 阅卷数据统计 -->
-            <MarkData></MarkData>
+            <MarkData v-show="isShowData"></MarkData>
         </vuescroll>
         <!-- 按人分配设置阅卷老师 -->
         <Modal v-model="addTeaStatus" :title="$t('learnActivity.mark.addTeaTitle')" class-name="dark-iview-modal dark-iview-table" @on-ok="okAddTea" :width="1000">
@@ -239,6 +239,7 @@ export default {
             quIds: [],
             mLoading: true,
             isSetting: false,
+            isShowData: false,
             ruleValidate: {
                 startTime: [
                     { required: true, type: 'number', message: this.$t('learnActivity.mark.startErr'), trigger: 'blur' }
@@ -722,6 +723,7 @@ export default {
                     if (res.correct) {
                         this.setting = res.correct
                         this.isSetting = true
+                        this.isShowData = true
                         //如果是按题分配模式需要转换数据格式
                         if (this.setting.mode == 'qu') {
                             this.quBlockes = []

+ 7 - 6
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -1,4 +1,4 @@
-<template>
+<template>
     <div class="my-course-container dark-iview-split">
         <Loading v-if="listLoading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
         <Split v-show="!isShowSchd" v-model="split1">
@@ -989,7 +989,7 @@ export default {
             //这里需要根据站点动态拼接域名
             let addr = this.$store.state.config.srvAdr
             let type = this.$store.state.config.srvAdrType
-            let host, clientId, loginDomain
+            let host, clientId, accUrl
             //国际站
             if (addr == 'Global') {
                 if (type == 'product') {
@@ -1000,7 +1000,7 @@ export default {
                     host = this.$store.state.config[addr].domainUrl[1].url
                 }
                 clientId = this.$store.state.config.Global.clientID
-                loginDomain = this.$store.state.config.Global.accAPIUrl
+                accUrl = this.$store.state.config.Global.accAPIUrl
             }
             // 大陆站
             else {
@@ -1010,15 +1010,16 @@ export default {
                     host = this.$store.state.config.China.domainUrl[1].url
                 }
                 clientId = this.$store.state.config.China.clientID
-                loginDomain = this.$store.state.config.China.accAPIUrl
-            }
+                accUrl = this.$store.state.config.China.accAPIUrl
+            } 
+            accUrl = 'https://account-rc.teammodel.cn' //暂时使用,待总部部署最新代码
             let state = this.$jsFn.getBtwRandom(1000, 9999)
             let idToken = localStorage.getItem('id_token')
             let tokenData = jwtDecode(idToken)
             let nonce = tokenData ? tokenData.nonce : ''
             let callbackUrl = `${host}/joinclass?listName=${listName}&tName=${tName}&listNo=${this.stuListNo}&cusName=${cusName}`
             let dcUrl = encodeURIComponent(callbackUrl)
-            let loginUrl = `${loginDomain}?response_type=code&client_id=${clientId}&state=${state}&nonce=${nonce}&redirect_uri=${dcUrl}`
+            let loginUrl = `${accUrl}/oauth2/authorize?response_type=code&client_id=${clientId}&state=${state}&nonce=${nonce}&redirect_uri=${dcUrl}`
             this.inviteUrl = loginUrl
             console.log(loginUrl)
             this.createQRCode(loginUrl)

+ 1 - 10
TEAMModelOS/ClientApp/src/view/student-account/stuMgt/ImportStudent.less

@@ -69,26 +69,17 @@
 }
 .confirm-btn {
     width: 36%;
-    min-width:200px;
     height: 40px;
     line-height: 40px;
     text-align: center;
-    background-color: #4f4f4f;
     margin: auto;
-    color: #A1A1A1;
     font-size: 18px;
-    font-weight: 600;
+    font-weight: 400;
     letter-spacing: 2px;
-    cursor: pointer;
     user-select: none;
     margin-top: 10px;
 }
 
-.confirm-btn-active {
-    background-color: #6DE2C4;
-    color: white;
-}
-
 .account-error-tips {
     color: #ed6565;
 }

+ 25 - 15
TEAMModelOS/ClientApp/src/view/student-account/stuMgt/ImportStudent.vue

@@ -70,21 +70,21 @@
                     <p>{{(row.pw == '' || row.pw == null)? '— —' : row.pw+''}}</p>
                 </template>
                 <template slot-scope="{ row }" slot="classYear">
-                    <p>{{ `${$jsFn.getGradeNameByYear(schoolBase, period, row.classYear)}(${row.classYear})` }}</p>
+                    <p>{{ `${$jsFn.getGradeNameByYear(schoolBase, period, row.classYear)}(${row.classYear}${$t('unit.gradeYear')})` }}</p>
                 </template>
                 <template slot-scope="{ row,index }" slot="status">
                     <!-- Excel 錯誤 -->
-                    <p :class="(excelValid.fieldIds.length == 0 || excelValid.fieldIds.indexOf(row.id) == -1) ? 'account-success-tips':'account-warning-tips'">{{(excelValid.fieldIds.length == 0 || excelValid.fieldIds.indexOf(row.id) == -1)?"" : $t('stuAccount.attrWarning') }}</p>
-                    <p :class="(excelValid.noReaptIds.length == 0 || excelValid.noReaptIds.indexOf(row.id) == -1) ? 'account-success-tips':'account-warning-tips'">{{(excelValid.noReaptIds.length == 0 || excelValid.noReaptIds.indexOf(row.id) == -1)?"":$t('stuAccount.setNoWarning') }}</p>
-                    <p :class="(excelValid.reaptIds.length == 0 || excelValid.reaptIds.indexOf(row.id) == -1) ? 'account-success-tips':'account-warning-tips'">{{(excelValid.reaptIds.length == 0 || excelValid.reaptIds.indexOf(row.id) == -1)?"": $t('stuAccount.idWarning') }}</p>
-                    <p :class="row.seatRepeat? 'account-error-tips':''">{{row.seatRepeat ? $t('stuAccount.setNoErr'):"" }}</p>
-                    <p :class="(excelValid.gradeIds.length == 0 || excelValid.gradeIds.indexOf(row.id) == -1) ? 'account-success-tips':'account-warning-tips'">{{(excelValid.gradeIds.length == 0 || excelValid.gradeIds.indexOf(row.id) == -1)?"": $t('stuAccount.gradeWarning') }}</p>
-                    <p :class="(excelValid.idErr.length == 0 || !excelValid.idErr.includes(row.id)) ? 'account-success-tips':'account-error-tips'">{{(excelValid.idErr.length == 0 || !excelValid.idErr.includes(row.id))?"": $t('stuAccount.idFormatWarning') }}</p>
-
+                    <p v-show="excelValid.fieldIds.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.attrWarning')}}</p>
+                    <p v-show="excelValid.noReaptIds.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.setNoWarning')}}</p>
+                    <p v-show="excelValid.reaptIds.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.idWarning')}}</p>
+                    <p v-show="row.seatRepeat" class="account-error-tips">{{$t('stuAccount.setNoErr')}}</p>
+                    <p v-show="excelValid.gradeIds.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.gradeWarning')}}</p>
+                    <p v-show="excelValid.idErr.includes(row.id)" class="account-error-tips">{{$t('stuAccount.idFormatWarning') }}</p>
+                    <p v-show="excelValid.idRep.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.idRepErr') }}</p>
                 </template>
             </Table>
             <p style="margin-top:15px;">{{$t('stuAccount.passwordTips')}}</p>
-            <Button class="confirm-btn" :class=" isError == 0 ?'confirm-btn-active':''  " :loading="uploadLoading" @click="saveFileData">
+            <Button class="confirm-btn" :disabled="!!excelValid.idErr.length" :loading="uploadLoading" @click="saveFileData">
                 {{$t('stuAccount.submitList')}}
             </Button>
         </div>
@@ -118,7 +118,8 @@ export default {
                 noReaptIds: [],
                 reaptIds: [],
                 gradeIds: [],
-                idErr: [] //id格式不对
+                idErr: [], //id格式不对
+                idRep: []// id已存在
             },
             totalNum: 0,
             seatRepeatNum: 0,
@@ -303,7 +304,6 @@ export default {
                     if (excelFlag) {
                         // 先歸零
                         this.errNumReset()
-
                         // 比較 students 取出已存在的教室內容
                         // 取出Excel重複的班級
                         let classIds = []
@@ -369,6 +369,17 @@ export default {
                             item.periodId = this.period
                             return item
                         })
+
+                        //筛选已存在的账号
+                        this.excelValid.idRep = []
+                        let systemIds = this.students.map(sItem => {
+                            return sItem.id
+                        })
+                        this.tableData.forEach(tItem => {
+                            if (systemIds.includes(tItem.id)) {
+                                this.excelValid.idRep.push(tItem.id)
+                            }
+                        })
                     }
 
                     this.$Message.info(this.$t('stuAccount.importTips11'))
@@ -500,7 +511,7 @@ export default {
                 } else {
                     // 座號重複檢核
                     let repNo = array.filter((i) => {
-                        return i.id != item.id && i.classId != undefined && i.classId != null && i.classId != '' && i.classId == item.classId && i.no == item.no
+                        return i.id != item.id && i.classId && i.classId == item.classId && i.no == item.no
                     })
                     if (repNo.length > 0) {
                         for (let no of repNo) {
@@ -514,17 +525,17 @@ export default {
                         _this.excelValid.idErr.push(item.id)
                     }
 
-                    // ID 重複
+                    // 导入数据中 ID 重複
                     let repID = array.filter((i, key) => {
                         return i.id == item.id && index != key
                     })
+
                     if (repID.length > 0) {
                         for (let id of repID) {
                             _this.excelValid.reaptIds.push(id.id)
                             _this.repeatNum++
                         }
                     }
-
                     // 年級與教室的組合必須一致
                     let classInfo = _this.classes.filter((i) => {
                         return item.classId == i.no
@@ -554,7 +565,6 @@ export default {
                     }
                 }
             })
-
             if ((_this.excelValid.noReaptIds.length + _this.excelValid.fieldIds.length + _this.excelValid.reaptIds.length + _this.excelValid.gradeIds.length) == 0) {
                 validFalg = true
             }

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

@@ -452,7 +452,7 @@ namespace TEAMModelOS.Controllers
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                string originCode = stuList.code;
+                string originCode = stuList.code.Replace("StuList-","");
                 //todo 需要校验是否重复
                 if (string.IsNullOrEmpty(stuList.no))
                 {
@@ -496,9 +496,7 @@ namespace TEAMModelOS.Controllers
                     }
                 }
 
-                //stuList.no = channelnum;               
-                stuList.code = stuList.pk + "-" + stuList.code;
-                //stuList.owner = originCode;
+                stuList.code = stuList.pk + "-" + stuList.code.Replace("StuList-","");
                 if (scope.ToString().Equals("school", StringComparison.OrdinalIgnoreCase))
                 {
                     stuList.scope = "school";