wuhongyuq 5 anni fa
parent
commit
851dea06d3

File diff suppressed because it is too large
+ 305 - 305
package-lock.json


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

@@ -4,7 +4,7 @@
       <el-col :span="24">
         <van-tabs v-model="active">
           <van-tab title="平时成绩">
-            <peaceAchieve v-on="$listeners" :formscore="formscore" :peaceAchieveList="peaceAchieveList" :score="score"></peaceAchieve>
+            <peaceAchieve v-on="$listeners" :peaceAchieveList="peaceAchieveList" :showPicker="showPicker" :peaceScore="peaceScore"></peaceAchieve>
           </van-tab>
           <van-tab title="作业成绩">
             <homeworkAchiece v-on="$listeners" :lesson="lesson" :achieveList="achieveList" :deptList="deptList" :show="show" :form="form"></homeworkAchiece>
@@ -22,8 +22,8 @@ export default {
   name: 'achieve',
   props: {
     peaceAchieveList: null, //平时成绩
-    score: null, //
-    formscore: null,
+    showPicker: null, //平時成绩显示
+    peaceScore: null, //平时成绩分数
     achieveList: null, //作业成绩
     show: null, //显示弹框
     form: null, //修改form

+ 11 - 11
src/layout/class/achieveList/peaceAchieve.vue

@@ -7,13 +7,17 @@
             {{ item.name }}
           </el-col>
           <el-col :span="12" class="score">
-            <span>分数:{{ item.score }}分</span>
+            <span>分数:{{ item.selfscore }}分</span>
             <el-button type="primary" size="mini" @click="showBtn(item.id)" round>选择</el-button>
           </el-col>
         </el-col>
       </el-col>
     </el-row>
-    <van-form>
+    <!-- <van-field readonly clickable name="picker" :value="value" placeholder="点击选择分数" @click="showPicker = false" /> -->
+    <van-popup v-model="showPicker" position="bottom">
+      <van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
+    </van-popup>
+    <!-- <van-form>
       <van-field v-model="formscore.score">
         <template #input>
           <van-popup v-model="score" position="bottom">
@@ -21,7 +25,7 @@
           </van-popup>
         </template>
       </van-field>
-    </van-form>
+    </van-form> -->
   </div>
 </template>
 
@@ -30,25 +34,21 @@ export default {
   name: 'peaceAchieve',
   props: {
     peaceAchieveList: null,
-    score: null,
-    formscore: null,
     showPicker: null,
+    peaceScore: null,
   },
   components: {},
   data: () => ({
-    columns: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
+    columns: ['1', '2', '3', '4', '5', '7', '8', '9', '10'],
   }),
   created() {},
   computed: {},
   methods: {
-    onConfirm() {
-      this.$emit('access', { data: this.form }, id);
-    },
     showBtn(id) {
       this.$emit('showBtn', id);
     },
-    showGuan() {
-      this.$emit('showGuan');
+    onConfirm(value) {
+      this.$emit('onConfirm', value);
     },
   },
 };

+ 0 - 1
src/util/axios-wrapper.js

@@ -50,7 +50,6 @@ export default class AxiosWrapper {
     return this.$request(uri, data, query, options, router);
   }
   async $request(uri, data, query, options) {
-    // TODO: 合并query和options
     if (_.isObject(query) && _.isObject(options)) {
       options = { ...options, params: query, method: 'get' };
     } else if (_.isObject(query) && !query.params) {

+ 25 - 30
src/views/class/achieve.vue

@@ -9,16 +9,13 @@
         <el-col :span="24" class="main">
           <achieves
             :peaceAchieveList="peaceAchieveList"
+            :showPicker="showPicker"
+            :peaceScore="peaceScore"
             @showBtn="showBtn"
-            @showGuan="showGuan"
-            @access="clickscore"
+            @onConfirm="onConfirm"
             :achieveList="achieveList"
             :show="show"
             :form="form"
-            :score="score"
-            :formscore="formscore"
-            @clickDialog="clickAchieve"
-            @submit="submitAchieve"
             :deptList="deptList"
             :lesson="lesson"
           ></achieves>
@@ -45,12 +42,12 @@ export default {
     achieves, //班级学生成绩列表
   },
   data: () => ({
-    lesson: [],
     peaceAchieveList: [],
-    deptList: [],
-    score: false,
-    formscore: {},
+    showPicker: false,
+    peaceScore: '',
     studid: '',
+    lesson: [],
+    deptList: [],
     achieveList: {},
     show: false,
     form: {},
@@ -63,7 +60,6 @@ export default {
   }),
   created() {
     this.search();
-    // this.searchLesson();
   },
   computed: {
     ...mapState(['user']),
@@ -83,43 +79,42 @@ export default {
     ...mapClass({ classinfo: 'fetch', classlist: 'query' }),
     ...mapLesson({ lessoninfo: 'fetch', classlist: 'query' }),
     ...mapUploadtask({ uploadtaskinfo: 'fetch', uploadtasklist: 'query' }),
-    async search({ ...info } = {}) {
+    // 平时成绩学生名单查询+作业成绩学生名单查询
+    async search() {
       let classid = this.user.classid;
       const res = await this.list({ classid });
       this.$set(this, `peaceAchieveList`, res.data);
       this.$set(this, `achieveList`, res.data);
-      const result = await this.classinfo(classid);
-      const lessonInfo = await this.uploadtasklist({ ...info });
-      // this.$set(this, `lesson`, lessonInfo.data.lessons);
-      console.log(lessonInfo);
-
-      // // const ress = await this.subjectlist();
-      // // const resss = await this.uploadtasklist();
-      // const ressss = await this.classlist({ classid });
     },
+    // 学委上作业分+存储学生id
     clickAchieve({ id }) {
       this.$set(this, `stuid`, id);
       this.show = true;
     },
+    // 学委上作业分提交
     async submitAchieve(form) {
       this.form.id = this.stuid;
       let data = this.form;
       const res = await this.uploadtaskupdate(data);
-      console.log(res);
       this.show = false;
     },
+    // 平时成绩上分显示+学生id
     showBtn(id) {
       this.$set(this, `studid`, id);
-      this.score = true;
-    },
-    showGuan() {
-      this.score = false;
+      this.showPicker = true;
     },
-    async clickscore(formscore) {
-      this.formscore.id = this.$route.query.id;
-      let data = this.formscore;
-      const ress = await this.updates(data);
-      this.score = false;
+    // 给学生上分
+    async onConfirm(peaceScore) {
+      let data = {};
+      data.id = this.studid;
+      data.selfscore = peaceScore;
+      const res = await this.updates(data);
+      this.$message({
+        message: '平时成绩上分成功',
+        type: 'success',
+      });
+      this.showPicker = false;
+      this.search();
     },
   },
 };

+ 2 - 1
vue.config.js

@@ -2,7 +2,8 @@ const path = require('path');
 const question = path.resolve(__dirname, '../question-examine');
 const frame = path.resolve(__dirname, '../frame');
 module.exports = {
-  publicPath: '/',
+  publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROOT_URL + 'teacher',
+
   configureWebpack: config => {
     Object.assign(config, {
       // 开发生产共同配置