zengyicheng 2 سال پیش
والد
کامیت
db07d9ee04
2فایلهای تغییر یافته به همراه65 افزوده شده و 10 حذف شده
  1. 58 6
      src/components/pages/components/worksDetail2.vue
  2. 7 4
      src/components/pages/data.vue

+ 58 - 6
src/components/pages/components/worksDetail2.vue

@@ -198,7 +198,19 @@
           :before-close="handleClose"
           width="100%"
           class="dialog_diy2 max_diy"
+          :class="{ fullStyle: full }"
         >
+          <div slot="title" class="header-title">
+            <div style="color: #fff">查看作业</div>
+            <div style="position: absolute; top: 14px; right: 50px">
+              <img
+                src="../../../assets/full.png"
+                style="height: 14px; cursor: pointer"
+                alt=""
+                @click="fullTools"
+              />
+            </div>
+          </div>
           <div class="zyBoxC">
             <div class="courseTitle" v-if="allWorks.course">
               <div class="txName">
@@ -227,7 +239,7 @@
                     <div
                       class="twoChild"
                       :class="{
-                        navActive: dy.id == stageIndex,
+                        navActive: dy.isOpen,
                       }"
                     >
                       <div
@@ -371,7 +383,7 @@
                         v-else-if="worksDetail[sIndex].answerInfo.length > 0"
                       >
                         <div class="answerbox">
-                          <div>问答标题</div>
+                          <div style="min-width: 80px">问答标题</div>
                           <div>
                             {{ worksDetail[sIndex].answerInfo[0].answerTitle }}
                           </div>
@@ -532,6 +544,7 @@
                           class="rate_size"
                           style="min-width: 120px"
                           v-model="worksDetail[sIndex].rateList[item.value]"
+                          @change="getStar(sIndex)"
                         ></el-rate>
                       </div>
                     </div>
@@ -686,6 +699,8 @@ export default {
       dialogVisible3: false,
       dialogVisible4: false,
       dataVisible: false,
+      full: false,
+      isStar: 0,
       studentInfo: {},
       courseByUser: "诗词中的植物",
       userName: "林点",
@@ -1153,6 +1168,7 @@ export default {
           }
           for (var c = 0; c < _dyList2.length; c++) {
             if (_dyList2[c].taskList.length) {
+              _dyList2[c].isOpen = c === 0 ? true : false;
               _dyList3.push(_dyList2[c]);
             }
           }
@@ -1343,6 +1359,9 @@ export default {
       this.page = 1;
       this.getWorks();
     },
+    fullTools() {
+      this.full = !this.full;
+    },
     //获取作业
     getWorks() {
       this.isLoading = true;
@@ -1435,6 +1454,31 @@ export default {
         );
       }
     },
+    getStar(i) {
+      const k = i;
+      var _ooption = JSON.parse(JSON.stringify(this.ooption[k]));
+      var _rate = this.worksDetail[i].rateList;
+      var _rateList = Object.keys(this.worksDetail[i].rateList);
+      for (var i = 0; i < _ooption.length; i++) {
+        if (_rateList.indexOf(_ooption[i].name) != -1) {
+          _ooption[i].value = _rate[_ooption[i].name];
+        }
+      }
+      // var _option = JSON.parse(JSON.stringify(this.radarOption));
+      var _option = this.radarOption;
+      _option.radar.indicator = [];
+      _option.series[0].data[0].value = [];
+      for (var i = 0; i < _ooption.length; i++) {
+        _option.radar.indicator.push({ name: _ooption[i].name, max: 5 });
+        _option.series[0].data[0].value.push(_ooption[i].value);
+      }
+      if (this.chartObj) {
+        // _option.series[0].data = _ooption;
+        this.chartObj[k].setOption(_option);
+      } else {
+        this.setChart(_ooption);
+      }
+    },
     updateWorks(scopeId, rateList, i) {
       let params = {
         rate: rateList,
@@ -1693,7 +1737,8 @@ export default {
         });
     },
     isOpen(s) {
-      this.stageIndex = s;
+      // this.stageIndex = s;
+      this.dyList2[s].isOpen = !this.dyList2[s].isOpen;
     },
     openTask(s, i) {
       var a = s + "-" + i;
@@ -2711,9 +2756,6 @@ export default {
   font-size: 18px;
   font-weight: bold;
 }
-.answerbox > div:nth-child(1) {
-  min-width: 70px;
-}
 .answerbox > div:nth-child(2) {
   margin-left: 15px;
 }
@@ -2755,4 +2797,14 @@ export default {
   justify-content: flex-end;
   margin: 10px 0;
 }
+.fullStyle >>> .el-dialog__body {
+  height: 100% !important;
+}
+.fullStyle >>> .el-dialog,
+.fullStyle {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 !important;
+}
 </style>

+ 7 - 4
src/components/pages/data.vue

@@ -178,7 +178,7 @@ export default {
           },
         ],
         phone: [
-          { required: true, message: "请输入你的手机号码", trigger: "blur" },
+          // { required: true, message: "请输入你的手机号码", trigger: "blur" },
 
           {
             validator: validatePass1,
@@ -212,7 +212,7 @@ export default {
         {
           userid: this.userid,
           username: this.ruleForm.name,
-          type:this.ruleForm.type == "老师" ? 1 : 2,
+          type: this.ruleForm.type == "老师" ? 1 : 2,
           oid: this.ruleForm.sBySchool,
           phone: this.ruleForm.phone,
           intro: this.ruleForm.intro,
@@ -325,12 +325,15 @@ export default {
   align-items: center;
   background: #fff;
 }
-.demo-ruleForm >>> .el-form-item__label:before {
+/* .demo-ruleForm >>> .el-form-item__label:before {
   content: "*";
   color: #f56c6c;
   margin-right: 4px;
 }
-.demo-ruleForm >>> .el-form-item__content{
+.demo-ruleForm >>> .el-form-item__label:nth-child(3) {
+  content: "";
+} */
+.demo-ruleForm >>> .el-form-item__content {
   width: 300px;
 }
 </style>