Browse Source

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-student

nihao 5 years ago
parent
commit
9e0bf5a141

+ 3 - 1
src/layout/class/achieve.vue

@@ -7,7 +7,7 @@
             <peaceAchieve :peaceAchieveList="peaceAchieveList"></peaceAchieve>
           </van-tab>
           <van-tab title="作业成绩">
-            <homeworkAchiece :achieveList="achieveList"></homeworkAchiece>
+            <homeworkAchiece v-on="$listeners" :achieveList="achieveList" :show="show" :form="form"></homeworkAchiece>
           </van-tab>
         </van-tabs>
       </el-col>
@@ -23,6 +23,8 @@ export default {
   props: {
     peaceAchieveList: null, //平时成绩
     achieveList: null, //作业成绩
+    show: null, //显示弹框
+    form: null, //修改form
   },
   components: {
     peaceAchieve, //平時成績

+ 29 - 2
src/layout/class/achieveList/homeworkAchiece.vue

@@ -16,6 +16,18 @@
         </van-collapse>
       </el-col>
     </el-row>
+    <van-dialog v-model="show" title="学生成绩上传" :showConfirmButton="false">
+      <van-form @submit="onSubmit">
+        <van-field v-model="form.name" name="学生名称" disabled />
+        <van-field v-model="form.lessonid" name="课程名称" label="课程名称" placeholder="请输入课程名称" />
+        <van-field v-model="form.score" name="作业分数" label="作业分数" placeholder="请输入作业分数" />
+        <div style="margin: 16px;">
+          <van-button round block type="info" native-type="submit">
+            提交
+          </van-button>
+        </div>
+      </van-form>
+    </van-dialog>
   </div>
 </template>
 
@@ -24,6 +36,9 @@ export default {
   name: 'homeworkAchiece',
   props: {
     achieveList: null,
+    show: null,
+    form: null,
+    lessonList: null,
   },
   components: {},
   data: () => ({
@@ -31,7 +46,14 @@ export default {
   }),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    clickBtn() {
+      this.$emit('clickDialog');
+    },
+    onSubmit() {
+      this.$emit('submit', { data: this.form });
+    },
+  },
 };
 </script>
 
@@ -56,7 +78,12 @@ p {
   font-size: 20px;
 }
 /deep/.van-cell {
-  border-radius: 10px;
+  border-top-left-radius: 10px;
+  border-top-right-radius: 10px;
+}
+/deep/.van-collapse-item__content {
+  border-bottom-left-radius: 10px;
+  border-bottom-right-radius: 10px;
 }
 /deep/.van-collapse-item {
   margin: 0 0 10px 0;

+ 0 - 3
src/layout/class/achieveList/peaceAchieve.vue

@@ -50,9 +50,6 @@ export default {
 .list {
   border-bottom: 1px dashed #333;
 }
-// .list:nth-child(2n) {
-//   background-color: #ccc;
-// }
 .list .name {
   padding: 15px 15px;
 }

+ 19 - 2
src/views/class/achieve.vue

@@ -6,7 +6,14 @@
           <topInfo></topInfo>
         </el-col>
         <el-col :span="24" class="main">
-          <achieves :peaceAchieveList="peaceAchieveList" :achieveList="achieveList"></achieves>
+          <achieves
+            :peaceAchieveList="peaceAchieveList"
+            :achieveList="achieveList"
+            :show="show"
+            :form="form"
+            @clickDialog="clickAchieve"
+            @submit="submitAchieve"
+          ></achieves>
         </el-col>
       </el-col>
     </el-row>
@@ -75,10 +82,20 @@ export default {
         ],
       },
     ],
+    show: false,
+    form: {},
   }),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    clickAchieve() {
+      this.show = true;
+    },
+    submitAchieve(form) {
+      console.log(form);
+      this.show = false;
+    },
+  },
 };
 </script>