XW před 4 roky
rodič
revize
880af3b58a

+ 34 - 39
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css

@@ -1,14 +1,40 @@
+/*常用色票*/
+/*回傳的狀態文字,標題段落的方框,分頁*/
+/*標題類型的標記,編序教材附件按鈕*/
+/*各類項目的懸停與選中狀態*/
+.vote .vote-option {
+  margin-top: 15px;
+  margin-bottom: 10px;
+}
+.vote .vote-option .option-group {
+  display: flex;
+  flex-direction: column;
+}
+.vote .vote-option .option-group .option-wrapper {
+  margin-bottom: 15px;
+  display: flex;
+  align-items: center;
+}
+.vote .vote-option .option-group .option-wrapper .ivu-checkbox {
+  margin-right: 5px;
+}
+.vote .option-repeat .ivu-checkbox {
+  display: none;
+}
+.vote .option-repeat .ivu-input-number {
+  width: 50px;
+}
 .vote .checkAnswer {
-    display: inline-flex;
-    min-width:100px;
-    margin-top: 15px;
-    margin-right:20px;
+  display: block;
+  margin-top: 20px;
+  margin-left: 0px;
 }
 .vote .checkAnswer .testBtn {
-  margin: 10px 0px;
+  margin: 20px 0px;
   position: relative;
   z-index: 2;
   font-weight: bolder;
+  padding-left: 20px;
   cursor: pointer;
 }
 .vote .checkAnswer .testBtn input[type="checkbox"] {
@@ -20,10 +46,6 @@
   border: none;
 }
 .vote .checkAnswer .testBtn input[type="checkbox"]:checked ~ .testbg span {
-  color: #5e5a6e;
-  font-weight: bolder;
-}
-.vote .checkAnswer .testBtn input[type="checkbox"]:checked ~ .testbg .vote-info {
   color: #fff;
   font-weight: bolder;
 }
@@ -35,20 +57,9 @@
   top: -31px;
   padding: 10px;
   z-index: 1;
+  display: flex;
   border-radius: 4px;
   border: 1px solid #c5c5c5;
-  display:flex;
-}
-    .vote  .vote-title {
-        width: 100%;
-        /*display: flex;*/
-}
-    .vote .vote-title .title-rect-group{
-        display:flex;
-    }
-.vote .checkAnswer .testbg .vote-info{
-    width:95%;
-    display:flex;
 }
 .vote .slide-fade-enter-active {
   transition: all 0.3s ease;
@@ -61,11 +72,6 @@
   transform: translateY(-5%);
   opacity: 0;
 }
-.vote .question-box {
-    display: flex;
-    margin-top: 10px;
-    font-size: 16px;
-}
 .vote .votefinished-icon {
   font-size: 80px;
   position: relative;
@@ -74,7 +80,7 @@
 }
 .vote .voteResultsItem {
   padding: 10px 20px;
-  /*padding-left: 80px;*/
+  padding-left: 80px;
   z-index: 0 !important;
   position: relative;
 }
@@ -106,19 +112,8 @@
 .vote .vote-chart-card {
   width: 50%;
 }
-.vote .select-voteTime{
-    margin-top:15px;
-}
-.vote .select-voteTime h3{
-   display:inline-flex;
-   width:100%;
-}
-.vote .select-voteBox{
-    float:right;
-    margin-top:-25px;
-}
 @media screen and (max-width: 1200px) {
-    .vote .vote-chart-card {
+  .vote .vote-chart-card {
     width: 70%;
   }
 }

+ 29 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.less

@@ -1,6 +1,35 @@
 @import 'color.less';
 .vote {
     //投票區按鈕
+    .vote-option{
+        margin-top: 15px;
+        margin-bottom: 10px;
+
+        .option-group{
+            display: flex;
+            flex-direction: column;
+
+            .option-wrapper{
+                margin-bottom: 15px;
+                display: flex;
+                align-items: center;
+                // font-weight: 600;
+
+                .ivu-checkbox{
+                    margin-right: 5px;
+                }
+            }
+        }
+    }
+    .option-repeat{
+        .ivu-checkbox{
+            display: none;
+        }
+        .ivu-input-number{
+            width: 50px;
+        }
+    }
+
     .checkAnswer {
         display: block;
         margin-top: 20px;

+ 84 - 83
TEAMModelOS/ClientApp/src/components/student-web/EventBasicInfo.vue

@@ -1,97 +1,98 @@
 <template>
-  <Row :gutter="30">
-    <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="title-part">
-      <h2 class="event-title">
-        <span class="title-mark" v-show="this.$store.getters.getItemTitle.eventType == 'exam'" >{{$t("studentWeb.home.exam")}}</span>
-        <span class="title-mark" v-show="this.$store.getters.getItemTitle.eventType == 'vote'" >{{$t("studentWeb.home.vote")}}</span>
-        <span class="title-mark" v-show="this.$store.getters.getItemTitle.eventType == 'survey'" >{{$t("studentWeb.home.survey")}}</span>
-        {{ this.$store.getters.getItemTitle.name }}
-      </h2>
-    </i-col>
-    <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="info-part">
-      <ul class="base-info" :class="{'base-infoEn':getCurrentLang()=='en'}">
-        <li
-          v-if="this.$store.getters.getItemTitle.eventType == 'exam' && paper.length !== 0 "
-        >
-          <svg-icon icon-class="subject" class="base-info-icon" />{{ $t('studentWeb.baseInfo.subject')}}
-        <span class="base-info-text">{{paper.length > 1? $t('studentWeb.event.allSubject'):paper[0].subject.name }}</span>
-          <!--<span class="base-info-text" v-if="getCurrentLang()=='en'">{{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}</span>-->
-        </li>
-        <!--<li>
-          <svg-icon icon-class="teacher" class="base-info-icon" />投票类型:
-          <span class="base-info-text">{{ this.$store.getters.getItemTitle.times }}</span>
-        </li>-->
-        <li>
-          <svg-icon icon-class="time" class="base-info-icon" />
-          <span>{{ !eventType ?  $t('studentWeb.baseInfo.period') :  $t('studentWeb.baseInfo.postTime') }}</span>
-          <span class="base-info-text" v-if="from != '通知'&&from != 'hiteach'">
-              <span>
-                  {{ !eventType ? dateFormat(this.$store.getters.getItemTitle.startTime) + "~" : ""}}
-              </span>
-              {{ dateFormat(this.$store.getters.getItemTitle.endTime) }}
-          </span>
-          <!--<span
-            class="base-info-text"
-            v-if="from == '通知'||from == 'hiteach'"
-          >{{ this.$store.getters.getItemTitle.endTime + " 14:20" }}54345</span>-->
-        </li>
-        <!--<li v-if=" from == 'hiteach'">
-           <svg-icon icon-class="time" class="base-info-icon" />{{$t('studentWeb.baseInfo.classTime')}}:
-          <span class="base-info-text">{{ this.$store.getters.getItemTitle.endTime }}</span>
-        </li>-->
-        <!--<li v-if="finishedCondition && !eventType && from != '通知'&&from!='hiteach'">
-           <svg-icon icon-class="done" class="base-info-icon" />
-          <span class="base-info-text">{{ $t('studentWeb.baseInfo.Fineshed')}}</span>
-        </li>
-        <li v-if="unfinishedCondition && !eventType && from != '通知'&&from!='hiteach'">
-           <svg-icon icon-class="undone" class="base-info-icon" />
-          <span class="base-info-text">{{ $t('studentWeb.baseInfo.unFinished')}}</span>
-        </li>-->
-      </ul>
-    </i-col>
-  </Row>
+    <Row :gutter="30">
+        <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang() == 'tw' ? 12 : 24" class="title-part">
+            <h2 class="event-title">
+                <span class="title-mark" v-show="this.$store.getters.getItemTitle.eventType == 'exam'" >{{$t("studentWeb.home.exam")}}</span>
+                <span class="title-mark" v-show="this.$store.getters.getItemTitle.eventType == 'vote'" >{{$t("studentWeb.home.vote")}}</span>
+                <span class="title-mark" v-show="this.$store.getters.getItemTitle.eventType == 'survey'" >{{$t("studentWeb.home.survey")}}</span>
+                {{ this.$store.getters.getItemTitle.name }}
+            </h2>
+        </i-col>
+        <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang() == 'tw' ? 12 : 24" class="info-part">
+            <ul class="base-info" :class="{'base-infoEn': getCurrentLang() == 'en'}">
+                <li
+                  v-if="this.$store.getters.getItemTitle.eventType == 'exam' && paper.length !== 0 "
+                >
+                    <svg-icon icon-class="subject" class="base-info-icon" />{{ $t('studentWeb.baseInfo.subject')}}
+                    <span class="base-info-text">{{paper.length > 1 ? $t('studentWeb.event.allSubject') : paper[0].subject.name }}</span>
+                    <!-- <span class="base-info-text" v-if="getCurrentLang()=='en'">{{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}</span> -->
+                </li>
+                <!--<li>
+                    <svg-icon icon-class="teacher" class="base-info-icon" />投票类型:
+                    <span class="base-info-text">{{ this.$store.getters.getItemTitle.times }}</span>
+                </li>-->
+                <li>
+                    <svg-icon icon-class="time" class="base-info-icon" />
+                    <span>{{ !eventType ? $t('studentWeb.baseInfo.period') : $t('studentWeb.baseInfo.postTime') }}</span>
+                    <span class="base-info-text" v-if="from != '通知' && from != 'hiteach'">
+                        <span>
+                            {{ !eventType ? dateFormat(this.$store.getters.getItemTitle.startTime) + "~" : ""}}
+                        </span>
+                        {{ dateFormat(this.$store.getters.getItemTitle.endTime) }}
+                    </span>
+                    <!--<span
+                      class="base-info-text"
+                      v-if="from == '通知'||from == 'hiteach'"
+                    >{{ this.$store.getters.getItemTitle.endTime + " 14:20" }}54345</span>-->
+                </li>
+                <!--<li v-if=" from == 'hiteach'">
+                    <svg-icon icon-class="time" class="base-info-icon" />{{$t('studentWeb.baseInfo.classTime')}}:
+                    <span class="base-info-text">{{ this.$store.getters.getItemTitle.endTime }}</span>
+                </li>-->
+                <!--<li v-if="finishedCondition && !eventType && from != '通知'&&from!='hiteach'">
+                    <svg-icon icon-class="done" class="base-info-icon" />
+                    <span class="base-info-text">{{ $t('studentWeb.baseInfo.Fineshed')}}</span>
+                </li>
+                <li v-if="unfinishedCondition && !eventType && from != '通知'&&from!='hiteach'">
+                    <svg-icon icon-class="undone" class="base-info-icon" />
+                    <span class="base-info-text">{{ $t('studentWeb.baseInfo.unFinished')}}</span>
+                </li>-->
+            </ul>
+        </i-col>
+    </Row>
 </template>
 
 <script>
 export default {
-  name: "EventBasicInfo",
-        props: [
-            "eventType", "from",
-            "paper"
-        ],
+    name: "EventBasicInfo",
+    props: [
+        "eventType",
+        "from",
+        "paper"
+    ],
 
-  computed: {
-    finishedCondition: function () {
-      return (
-        this.$store.getters.getItemTitle.isDone ||
-        this.$store.getters.getFinishedItem.includes(
-          this.$store.getters.getItemTitle.eventID
-        ) == true
-      );
+    computed: {
+        finishedCondition: function () {
+            return (
+                this.$store.getters.getItemTitle.isDone ||
+                this.$store.getters.getFinishedItem.includes(
+                  this.$store.getters.getItemTitle.eventID
+                ) == true
+            );
+        },
+        unfinishedCondition: function () {
+            return (
+                !this.$store.getters.getItemTitle.isDone &&
+                this.$store.getters.getFinishedItem.includes(
+                  this.$store.getters.getItemTitle.eventID
+                ) == false
+            );
+        },
     },
-    unfinishedCondition: function () {
-      return (
-        !this.$store.getters.getItemTitle.isDone &&
-        this.$store.getters.getFinishedItem.includes(
-          this.$store.getters.getItemTitle.eventID
-        ) == false
-      );
+    mounted() {
     },
+    methods: {
+        dateFormat(timestamp) {
+            var date = new Date(timestamp)
+            var Y = date.getFullYear() + '-'
+            var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+            var D = date.getDate() + ' '
+            return Y + M + D;
         },
-        mounted() {
+        getCurrentLang() {
+            return localStorage.getItem('lang');
         },
-        methods: {
-            dateFormat(timestamp) {
-                var date = new Date(timestamp)
-                var Y = date.getFullYear() + '-'
-                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-                var D = date.getDate() + ' '
-                return Y + M + D;
-            },
-    getCurrentLang() {
-      return localStorage.getItem('lang');
     },
-  },
 };
 </script>
 

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

@@ -594,6 +594,7 @@
                             if (this.examInfo.stuScore[i] == -1) {
                                 info.noAns++
                             } else if (this.examInfo.stuScore[i] == this.paperData[i].score && this.examInfo.stuScore[i] != -1) {
+                                // 得了满分才算做对
                                 info.right++
                             } else {
                                 info.wrong++

+ 14 - 13
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -168,19 +168,6 @@
                 }
                 this.isLoad = false
             },
-            dateFormat(timestamp) {
-                var date = new Date(timestamp)
-                var Y = date.getFullYear() + '-'
-                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-                var D = date.getDate() + ' '
-                return Y + M + D;
-            },
-            hidehint() {
-                this.ishideHint = !this.ishideHint;
-            },
-            opentest: function () {
-                this.$store.commit("ToggleLessonTestPop");
-            },
             opentestWithSubject(item) {
                 if (item !== undefined) {
                     this.getPaper(item)
@@ -232,6 +219,20 @@
                     }
                 }
             },
+            /* =====未调用===== */
+            dateFormat(timestamp) {
+                var date = new Date(timestamp)
+                var Y = date.getFullYear() + '-'
+                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+                var D = date.getDate() + ' '
+                return Y + M + D;
+            },
+            hidehint() {
+                this.ishideHint = !this.ishideHint;
+            },
+            opentest: function () {
+                this.$store.commit("ToggleLessonTestPop");
+            },
         },
         computed: {
             listData() {

+ 28 - 3
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -42,9 +42,34 @@
                     </Button>
                 </div>
                 <!-- 投票内容 -->
-                <div class="question-box"><span v-html="voteInfo.description"></span></div>
-                <div>
-                    <div class="checkAnswer" v-for="(item, index) in voteInfo.options" :key="index">
+                <!-- <div class="question-box">
+                    <span v-html="voteInfo.description"></span>
+                </div> -->
+                <div class="vote-option">
+                    <!-- 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">
+                            <span v-html="item.value"></span>
+                        </Radio>
+                    </RadioGroup>
+                    多票  不重复
+                    <CheckboxGroup v-model="voteChecked" v-if="voteInfo.voteNum > 1 && !voteInfo.repeat" class="option-group">
+                        <Checkbox :label="item.code" v-for="(item, index) in voteInfo.options" :key="index" class="option-wrapper">
+                            <span v-html="item.value"></span>
+                        </Checkbox>
+                    </CheckboxGroup>
+                    多票  重复
+                    <CheckboxGroup v-model="voteChecked" v-if="voteInfo.voteNum > 1 && voteInfo.repeat" class="option-group option-repeat">
+                        <Checkbox :label="item.code" v-for="(item, index) in voteInfo.options" :key="index" class="option-wrapper">
+                            <InputNumber v-model="item.count"
+                                         :min="0"
+                                         size="small"
+                                         :formatter="value => `${value}` +$t('studentWeb.vote.tickets')"
+                            ></InputNumber>
+                            <span v-html="item.value"></span>
+                        </Checkbox>
+                    </CheckboxGroup> -->
+                    <div class="checkAnswer" v-for="(item, index) in voteInfo.options" :key="index">  
                         <label class="testBtn">
                             <input type="checkbox" :value="item" v-model="voteChecked" @click="getVote(item)" />
                             <div class="testbg">

+ 38 - 25
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue

@@ -212,13 +212,14 @@
 </template>
 
 <script>
+import { mapGetters, mapState } from 'vuex';
     import PreviewProgressPie from "../EventView/PreviewProgressPie";
     export default {
         name: "EventList",
         mounted() { 
             this.getActivityInfo()
-            this.selectedCondition(this.$store.getters.getItemTitle);
-            if (this.$store.getters.getIsSelectedNow == false) {
+            this.selectedCondition(this.getItemTitle);
+            if (this.getIsSelectedNow == false) {
                 this.predealMockdatafirstItem();
             }
             this.scrollList();
@@ -299,22 +300,37 @@
                 } else this.isListNoItem = false;
             },
         },
+        computed: {
+            ...mapState({
+                studentProfile: state => state.user.studentProfile,
+                schoolCode: state => state.user.schoolCode,
+                userInfo: state => state.userInfo,
+            }),
+            ...mapGetters([
+                "getItemTitle",
+                "getIsSelectedNow",
+                "getisFromInfoPoptoScroll",
+                "getFilterType",
+                "getFinishedItem",
+                "getFinishedItemTime"
+            ])
+        },
         methods: {
             //获取活动信息数据
             getActivityInfo() {
                 this.eventList.length = 0
                 this.isListNoItem = true;
-                if (this.$store.state.user.studentProfile.classinfo.id !== "") {
-                    let classInfo = [this.$store.state.user.studentProfile.classinfo.id]
-                    if (this.$store.state.user.studentProfile.courses.length) {
-                        for (let item of this.$store.state.user.studentProfile.courses) {
+                if (this.studentProfile.classinfo.id !== "") {
+                    let classInfo = [this.studentProfile.classinfo.id]
+                    if (this.studentProfile.courses.length) {
+                        for (let item of this.studentProfile.courses) {
                             classInfo.push(item.id)
                         }
                     }
                     let params = {
-                        userid: this.$store.state.userInfo.sub,
+                        userid: this.userInfo.sub,
                         userType: "schoolid",
-                        school: this.$store.state.user.schoolCode
+                        school: this.schoolCode
                     }
                     this.$api.studentWeb.getActivityInfo(params).then(res => {
                         if (res) {
@@ -441,7 +457,7 @@
                     return true;
                 }
             },
-            //选择所有
+            // 选择所有
             selectAllType() {
                 this.eventTypeCheckers = '';
                 this.predealMockdatafirstItem();
@@ -474,12 +490,12 @@
                 this.$store.commit("SetTrytestCount", [0, 0, 0]);
             },
             scrollListfromInfoPop() {
-                if (this.$store.getters.getisFromInfoPoptoScroll == true) {
+                if (this.getisFromInfoPoptoScroll == true) {
                     //當從通知操作進行捲動時,將篩選條件清空
                     this.selectedEventStatusNow = this.$t('studentWeb.event.allStatus');
                     this.eventTypeCheckers = "";
                     let targetItem = document.getElementById(
-                        `event${this.$store.getters.getItemTitle.eventID}`
+                        `event${this.getItemTitle.eventID}`
                     );
                     let scrollList = document.querySelectorAll(
                         ".event-list .list-block"
@@ -502,8 +518,8 @@
             },
             selectedCondition(item) {
                 if (
-                    this.$store.getters.getIsSelectedNow == true &&
-                    this.$store.getters.getItemTitle.id == item.id
+                    this.getIsSelectedNow == true &&
+                    this.getItemTitle.id == item.id
                 ) {
                     return true;
                 } else return false;
@@ -550,7 +566,7 @@
             },
             sentEvenType(eventype) {
                 this.$store.commit("ChangeFilterType", eventype);
-                if (this.$store.getters.getFilterType == "all") {
+                if (this.getFilterType == "all") {
                     let filterListFinished = [],
                         filterListUnFinished = [];
                     for (let i = 0; i < this.mockdata.length; i++) {
@@ -571,7 +587,7 @@
                     }
                     this.defaultFirstItem = filterListUnFinished[0];
                     if (
-                        this.$store.getters.getIsSelectedNow == false &&
+                        this.getIsSelectedNow == false &&
                         this.defaultFirstItem != ""
                     ) {
                         this.sentSelectedEventTitle(this.defaultFirstItem);
@@ -581,34 +597,31 @@
                 }
             },
             eventypeSelected: function (type) {
-                if (this.$store.getters.getFilterType == type) return true;
+                if (this.getFilterType == type) return true;
                 else return false;
             },
             scrollList() {
             },
             showTheCurrentTab() {
                 if (
-                    (this.finishedListNoItem == false &&
-                        this.$store.getters.getItemTitle.isDone == true) ||
-                    this.$store.getters.getFinishedItem.includes(
-                        this.$store.getters.getItemTitle.eventID
-                    )
+                    (this.finishedListNoItem == false && this.getItemTitle.isDone == true)
+                    || this.getFinishedItem.includes(this.getItemTitle.eventID)
                 )
                     return "tab2";
                 else return "tab1";
             },
             finishedcondition(item) {
-                if (this.$store.getters.getFinishedItem.includes(item.eventID) == true) {
+                if (this.getFinishedItem.includes(item.eventID) == true) {
                     this.havejustfinishedItem = true;
                     return true;
                 } else return false;
             },
             finishedItemtime(item) {
-                if (this.$store.getters.getFinishedItem.includes(item.eventID) == true) {
-                    let timeIndex = this.$store.getters.getFinishedItem.indexOf(
+                if (this.getFinishedItem.includes(item.eventID) == true) {
+                    let timeIndex = this.getFinishedItem.indexOf(
                         item.eventID
                     );
-                    return this.$store.getters.getFinishedItemTime[timeIndex];
+                    return this.getFinishedItemTime[timeIndex];
                 }
             },
         },